by Joe Meilinger
Text
> docker ps # list running containers
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
> docker images # list images in local registry
REPOSITORY TAG IMAGE ID CREATED SIZE
> cat Dockerfile
FROM python:3.8
WORKDIR /app
COPY . /app
RUN pip install -r requirements.txt
ENTRYPOINT ["python", "app.py"]
> docker build . # builds docker image using auto-generated name and ID
> docker build . -t my-image # builds docker image, tagging w/ "latest"
> docker build . -t my-image:1.0 # builds docker image, tagging w/ "1.0"
> docker run [IMAGE] # runs image by repo:tag OR image id using default entrypoint
> docker run -it [IMAGE] /bin/bash # runs image using your specified entrypoint (/bin/bash)
> docker run -p 3000:5000 [IMAGE] # runs image, mapping port 5000 on the container 3000 on host
Image Registry
img1
img2
img3
container1
from img1
Docker runtime
> docker run -v "$(pwd)":/app [IMAGE] # run image, mount current host folder to /app on container
> docker exec -it [CONTAINER_ID] /bin/bash # execute command on running container (/bin/bash)
> cat vars
VAR1=VAL1
VAR2=VAL2
> docker run --env-file vars [IMAGE] # runs image, using env variables from "vars" file
API
UI
Docker runtime
Docker runtime
C3PO DB
C3PO API
FGDRT API
FGDRT UI
localhost:3001
> docker-compose -d --build
> docker-compose --build