Image: dockergithub.png

Dockerfile & Github

by on
1 minute read

create a simple docker container and upload it to Github

dockergithub

Setup and configure Github Token

  1. Create Github Token and save the token.
  2. Authenticate with:
    (replace ‘YOUR_TOKEN’ with token from last step)
    export CR_PAT=YOUR_TOKEN
    
  3. Last sign in with:
    (replace ‘USERNAME’ with your Github Username)
    echo $CR_PAT | docker login ghcr.io -u USERNAME --password-stdin
    

Setup container files

  1. Download this repository
  2. Open terminal, go to the repo location (eg: ~/Documents/dckrtmplt) and do:
    docker build -t dckrtmplt . ; \
    docker tag dckrtmplt ghcr.io/sthopeless/dckrtmplt:latest ; \
    docker push ghcr.io/sthopeless/dckrtmplt:latest
    
  3. Your new Package should be visible at:
    https://github.com/Sthopeless?tab=packages
    (replace ‘Sthopeless’ with your Github Username)
  4. You can test running:
    docker run -it --rm ghcr.io/sthopeless/dckrtmplt:latest
    
  5. Set package visibility from Private to Visible, follow pictures:

1.

2.

3.

comments powered by Disqus