Skip to content

Instantly share code, notes, and snippets.

@beliaev-maksim
Last active May 15, 2023 10:05
Show Gist options
  • Save beliaev-maksim/9ffe7356083afa1360f8fdc93f99ebc4 to your computer and use it in GitHub Desktop.
Save beliaev-maksim/9ffe7356083afa1360f8fdc93f99ebc4 to your computer and use it in GitHub Desktop.
Publish image on ghcr
# Login using environment variables for GitHub username and API tocken
docker login ghcr.io --username $GH_USER --password=$GH_TOKEN
# Build image, execute from the directory with `Dockerfile`
docker build -t api_demo_server .
# tag an image with ghcr tag and version
docker tag api_demo_server ghcr.io/beliaev-maksim/api_demo_server:1.0.0
# now push your image to web host
docker push ghcr.io/beliaev-maksim/api_demo_server:1.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment