Docker: Create Image

#docker #sysadmin
  • Create an image
$ cd /path/to/Dockerfile
$ docker build -t user/repo .
  • Create a container
$ docker run -it IMAGE /bin/sh

Exit the container once you receive a root prompt.

  • Commit change
$ docker commit -m "initial commit" CONTAINERID user/repo:tag
  • Push to docker hub
$ docker push user/repo