Managing Docker Images - Openshift Tutorial
- Install git and Download a Demo Application
- Create/Modify Docker file for the Application
- Build the Image from Downloaded Application using Docker File
- Run the Container from Local Image
- Tag and Push the Image to Docker Hub
- Remove the Image.
- Local CentOS 7 VM with root access.
- Docker-Engine pre-installed.
Sequence 1. Working with Containerized Application
- Pull sample app and clone an application from Github for testing
- Check the contents of Dockerfile in the bulletin board application.
- Run the following command to build your bulletin board image:
- Run your image as a container by executing following command:
- Visit your application in a browser at http://localhost:8000 or from your host machine visit http://10.10.0.200:8000. You should see your bulletin board as given in the screen shot.
Share Your Image on Docker Hub. Use the docker command in your terminal to login
- Check the image ID and create an additional tag for your image which should be pushed to Docker Hub.:
- Now use the docker push command to actually push the image to Docker Hub and make it available publicly, so that it can be used anywhere:
- Verify your Image on Docker Hub. Open the Tags tab to check the image pushed
Clean up. Once you’re satisfied that your bulletin board container works correctly, you can delete it: