- Enter the root user account
- sudo -i
- View current running docker containers to find the one you want to upload
- Docker ps -a
- You can make sure its the correct machine by interfacing with it and checking the files
- Docker exec -it <CONTAINER ID> (EX: 50b2e9d0dff6) bash
- Docker exec -it 50b2e9d0dff6 bash
- Here you can use it as you would a regular CMD Linux PC
- To exit the container, do the command: “exit”
- Commit Container to an Image (This turns the container into a docker image for reuse)
- Docker commit <CONTAINER ID> <DOCKER HUB USERNAME>/<Your_Image_Name>
- EX: docker commit 50b2e9d0dff6 mpeck/ubuntu-modified
- Log into your Docker Hub account on the docker-machine
- docker login
- You will then enter your docker hub username and password
- Push the docker image to Docker Hub
- docker push <username>/<Image_Name>
- EX: docker push mpeck/ubuntu-modified
- Check Docker Hub
- https://hub.docker.com/
- Log into the account you used to push the container
- Check the “repository” tab for your container.