Dockeris a platform for developers and sysadmins to develop, deploy and run applications with containers.
- The use of Linux containers to deploy applications is called
imageis an executable package that includes everything needed to run an application - the code, a runtime, libraries, environment variables, and configuration files.
containeris simply a running instance of an
containerruns as a simple process as seen by
images(which ensure your app, its dependencies and the runtime, all travel together,) are defined by something called a
- In a distributed application, different pieces of the app are called
services. Services are really just containers in production. To define, run and scale services with the Docker platform, write a
- A single service stack can run 5 container instances of our deployed image on one host.
- A single container running in a service is called a
If you build an app the Docker way, at the bottom of the hierarchy of such an app is a
Above this level is a
service, which defines how the containers behave in production. Finally, at
the top level is the
stack, defining the interactions of all
docker --version: see docker version.
--) : see more info about your docker installation.
docker image lsor
docker images: list all the images.
docker container ls: list all the running containers.
docker container ls --all: list all the containers, including those exited after running.
docker container ls -aq: list docker containers, all in quiet mode.
docker container COMMAND: manage containers.
docker ps -as: list (all) containers (with sizes).
sudo service docker restart: restart docker service on Linux.
docker run -p 4000:80 IMAGE-NAME: run docker with port remapping, 4000 is the host port, 80 is service port.
docker tag helloworld soham/get-started: associate a local image named
helloworldwith a repository named
soham/helloworldon a registry. The tag is optional, but recommended for the registry to give Docker images a version.
docker push soham/helloworld: publish the image by uploading your tagged image to the repository. Once complete, the result of this upload are publicly available.
docker run -p 4000:80 soham/helloworld: pull and run the image from the remote repository. (If the image is not available locally, docker pulls it from the remote repository.)
To use TensorFlow Docker with GPU enabled in Pycharm, you need to modify docker default runtime,
because it seems impossible to pass
--gpus all running option when starting containers in Pycharm.
sudo apt install nvidia-container-runtime. Then modify