- Install Docker CE
- Build the Docker Image using build args
- See the
Build an image
section below. - Once built, an image can be dispatched to N containers
- There is not hot loading set up. Any changes, force a container rebuild
- To keep an old version of a container, increment the tag (currently 0.1)
- Builds and containers can get heavy
- Remove old containers when they finish running
- Remove old images that have been deprecated
- Notes
- The host machine's
localhost
is normally172.17.0.1
within a running container - The docker IP is normally
172.17.0.2
docker build --build-arg MYBUILDARG="ABCDEF1234567890" -t myimage:0.1 .
docker run -it myimage:0.1 bash
Note: Very helpful to prep unix os based builds
- To run a container and remove it once it has completed its job:
docker run --rm myimage:0.1 python3 execute.py
- To save the container state after finishing its job:
docker run myimage:0.1 python3 execute.py
docker ps -a
docker rm <container hash>
docker rm $(docker ps -a -q)
docker images -a
docker rmi <name>:<tag>
docker rmi <image hash>
docker system prune -a