Note: IMAGE_NAME
should be replaced with some unique name.
- Build the Dockerfile in the current directory:
docker build -t IMAGE_NAME .
- Get the size of the resulting Docker image:
docker image save IMAGE_NAME | wc -c | numfmt --to=si
- Run the resulting Docker image for web apps:
docker run -p 127.0.0.1:80:3000 IMAGE_NAME
- Open a shell in a Docker image:
docker run -it --rm IMAGE_NAME /bin/bash