Posts

Showing posts from July, 2021

Docker Notes

Image
1. Pull a Docker Container with/without tags. By default, Docker will pull the :latest image. Pull The busybox image from here: hub.docker.com docker pull busybox // same thing as latest docker pull busybox:latest docker pull busybox:1.24 2. Run a docker container docker run -i -t busybox:1.24 // pops an interactive shell docker run -it busybox:1.24 // same thing, switch -it combined docker run -name hello_world busybox:latest echo hello // runs it for a second 3. List Running Containers docker ps -OR- docker container list 4. Running a Container with Port docker run -it -p 8080:8080 tomcat:8.0 - OR - docker run -d -it -p 8080:8080 tomcat:8.0 //detached mode // runs in background docker logs 33929010101010101 // get logs for -d 5. Save changes to Container docker ps -a (copy short Container ID) docker commit 4b6df73fb04a amanda/debian:1.00 sha256:5e38921b9a8ff1980a31d711a008db522f9f24feeda167b6a75501ccb9d925bd docker images 6. DockerFiles A Dock