
Dockerfile & Github
1 minute read
create a simple docker container and upload it to Github
Setup and configure Github Token
- Create Github Token and save the token.
- Authenticate with:
(replace ‘YOUR_TOKEN’ with token from last step)export CR_PAT=YOUR_TOKEN
- Last sign in with:
(replace ‘USERNAME’ with your Github Username)echo $CR_PAT | docker login ghcr.io -u USERNAME --password-stdin
Setup container files
- Download this repository
- 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
- Your new Package should be visible at:
https://github.com/Sthopeless?tab=packages
(replace ‘Sthopeless’ with your Github Username) - You can test running:
docker run -it --rm ghcr.io/sthopeless/dckrtmplt:latest
- Set package visibility from Private to Visible, follow pictures:
1.
2.
3.
I feedback.
Let me know what you think of this article on twitter @Sthope_dev or leave a comment below!
Let me know what you think of this article on twitter @Sthope_dev or leave a comment below!
comments powered by Disqus