Thursday, June 22, 2023

Few un-common things to know about Docker

How to push your local images to remote docker hub?

    • Create an account on docker hub via URL https://hub.docker.com/signup
    • Login to the account using the credentials
    • Create a repository from the webpage where you want to push your images to.
    • Create the docker image on your local using command
      • docker build -t {image-name} .
    • Login to docker cli using command
      • docker login
    • Enter the docker hub id and password
    • Create a tag for your local docker image using command
      • docker tag {local-image-name}:{local-tag-version}{remote-repository-name}/{remote-image-name}:{remote-tag-version} 
    • Push your tag to the repository using command
      • docker push {remote-repository-name}/{remote-image-name}:{remote-tag-version} 
    • Now you can use the docker hub image using command
      • docker run -d -p 8080:8080 {remote-repository-name}/{remote-image-name}:{remote-tag-version}

No comments:

Post a Comment

SpringBoot Application Event Listeners

When a spring boot application starts few events occurs in below order ApplicationStartingEvent ApplicationEnvironmentPreparedEvent Applicat...