Skip to content

Latest commit

 

History

History
79 lines (52 loc) · 1.3 KB

SETUP_DOCKER_GUIDE.md

File metadata and controls

79 lines (52 loc) · 1.3 KB

Setup Docker Guide

Docker Hub

  • Login account at local

      docker login -u <your-username> -p <your-password>
  • Build Image

      docker build -t <your-dockerhub-username>/<image-name>:<tag> .
  • Push Image

      docker push <your-dockerhub-username>/<image-name>:<tag>
  • Pull Image

      docker pull <your-dockerhub-username>/<image-name>:<tag>
  • Run Container

      docker run -d -p <external-port>:<internal-port> <your-dockerhub-username>/<image-name>:<tag>

Github Container Registry (ghcr)

  • Login account at local

      echo <YOUR_PERSONAL_ACCESS_TOKEN> | docker login ghcr.io -u <YOUR_GITHUB_USERNAME> --password-stdin
  • Build Image

      docker build -t ghcr.io/<your-github-username>/<image-name>:<tag> .
  • Push Image

      docker push ghcr.io/<your-github-username>/<image-name>:<tag>
  • Pull Image

      docker pull ghcr.io/<your-github-username>/<image-name>:<tag>
  • Run Container

      docker run -d -p <external-port>:<internal-port> ghcr.io/<your-github-username>/<image-name>:<tag>

Check status Container

  • List Container is running

      docker ps
  • Check log of Container

      docker logs <container-id>