Low Orbit Flux Logo 2 F

Docker Cheat Sheet - SM

More complete Docker cheat sheet with explainations:

docker run -it ubuntu bash docker start smelly-hippo docker stats
docker run -it ubuntu docker stop smelly-hippo docker stats smelly-hippo
docker run -tid ubuntu restart, pause, unpause, wait (block) docker top smelly-hippo
docker create -ti ubuntu docker kill smelly-hippo docker logs web
docker run -tid --name smelly-hippo ubuntu docker events
docker ps docker rm smelly-hippo docker port nostalgic_colden
docker ps -a docker rm -f smelly-hippo
docker inspect smelly-hippo docker container rm -f $(docker ps -aq)
mkdir mydockerbuild
cd mydockerbuild
vi Dockerfile
docker build -t mydockerimage .
docker run -tid mydockerimage

FROM ubuntu
RUN apt update
RUN apt install nginx -y
WORKDIR ~/
CMD "echo" "Hello docker!"
ENV SERVER_WORKS 4
EXPOSE 8080
LABEL version="1.0"
USER 751
VOLUME ["/my_files"]
COPY test relativeDir/

    
docker images
docker image rm user1/funny-frog
docker rmi $(docker images -q)
docker commit smelly-hippo
docker commit smelly-hippo loworbitflux/test1:my-update
docker info | grep -i storagedocker run -tid -p 1234:80 nginx # host:container
docker inspect web # look for "Mounts"docker run -tid -p 127.0.0.1:1234:80 ubuntu
docker volume ls
docker volume create testvol1
docker volume inspect testvol1Bridge is used by default, IPs are optional
docker volume ls -f dangling=truedocker network ls
docker volume rm volume1docker network inspect bridge
docker run -d --name test1 -v /data ubuntudocker network rm my-network
docker run -d --name test2 -v vol1:/data ubuntudocker run -tid --net=my-network --ip=192.168.25.5 --name=test1 ubuntu
docker run -d --name test3 -v /src/data:/data ubuntudocker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container1
docker rm -v test1

–publish 8080:80