Last active
March 30, 2020 14:50
-
-
Save linuxbiekaisar/fa144d89c3478ec67cfc13a8f0269216 to your computer and use it in GitHub Desktop.
Running, Managing and Committing change in Docker Container and Push Docker image to reporisotory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Youtube: https://www.youtube.com/watch?v=GAobBjs_XtA&t=76s | |
#!/bin/sh | |
# To run a Docker Container | |
docker run -it ubuntu | |
apt update | |
apt install nodejs | |
node -v | |
exit | |
# Manage a Docker Container | |
docker ps | |
docker ps -a | |
docker ps -l | |
docker start d9b100f2f636 | |
docker stop NAME of file (ubuntu) | |
docker rm NAME of file (ubuntu) | |
# Committing Changes in a Container to a Docker Image | |
docker commit -m "What you did to the image" -a "Author Name" container_id repository/new_image_name | |
docker commit -m "added Node.js" -a "linuxbiekaisar" d9b100f2f636 kaisar/ubuntu-nodejs | |
docker images | |
# Push Docker Images to a Docker Repository | |
docker login -u docker-registry-username | |
docker login -u linuxbiekaisar | |
#Note: If your Docker registry username is different from the local username you used to create the image, you will have to tag your image with your registry username. For the example given in the last step, you would type: | |
sudo docker tag linuxbiekaisar/ubuntu-nodejs docker-registry-username/ubuntu-nodejs | |
#Then you may push your own image using: | |
docker push docker-registry-username/docker-image-name | |
#To push the ubuntu-nodejs image to the sammy repository, the command would be: | |
docker push kaisar/ubuntu-nodejs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment