Skip to content

Instantly share code, notes, and snippets.

@edgarmarkosov
Last active February 19, 2018 13:30
Show Gist options
  • Save edgarmarkosov/6a0ebe52c4c288fe7c19ed561629d0e4 to your computer and use it in GitHub Desktop.
Save edgarmarkosov/6a0ebe52c4c288fe7c19ed561629d0e4 to your computer and use it in GitHub Desktop.
Docker images and containers
While you are in the mydockerbuild directory, build the image using the docker build command.
The -t parameter gives your image a tag, so you can run it more easily later.
Don’t forget the . command, which tells the docker build command to look in the current directory for a file called Dockerfile.
docker build -t docker-whale .
docker images --> lists the images you have locally.
docker run docker-whale --> run image
docker tag 7d9495d03763 emarkosov/docker-whale:latest --> tag docker file
Pushing to Docker Hub:
docker login
docker push emarkosov/docker-whale:lates
docker rmi -f 7d9495d03763 --> removes the image
docker run emarkosov/docker-whale:latest --> If the image is no longer available on your local system, Docker downloads it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment