-
Notifications
You must be signed in to change notification settings - Fork 5
Home
Ensong Wei edited this page Dec 4, 2024
·
4 revisions
It should be a package for your real environment.
pip install easier-docker
Two params it need now, and network_config
and extra_config
are kwargs:
Note
-
container_config: Necessary, run and manage containers on the server. Run a container. By default, it will wait for the container to finish and return its logs, similar to
docker run
. -
network_config: Unnecessary, create and manage networks on the server. For more information about networks, see the Engine documentation. Create a network. Similar to the
docker network create
. - extra_config: Unnecessary, add extra configurations to the container.Currently used to control whether existing containers will be automatically removed.
Two params config please check:
Important
- container_config: Docker SDK for Python with Container
- network_config: Docker SDK for Python with Network
-
extra_config: Include and default value:
is_remove
,days_ago_remove
,remove_now
,
is_remove
: default value is0
, if it is1
, enable function that will remove the existing container with the same name.
days_ago_remove
: default value is3
, it will remove the existing container with the same name if it is older than the specified number of days.
remove_now
: default value is0
, if it is1
,days_ago_remove
will be ineffective, it will remove the existing container with the same name immediately.
python example.py
and the docker container logs will be shown in the console.
docker_example.py
Note
Currently supports type of file: yml, yaml, json
easier-docker -c config.yaml