Skip to content

Commit 24dc5c6

Browse files
Merge pull request #2 from FreeThinker78/AddContainer
Create package hello-world v1.0.0
2 parents 69f6a43 + a03935e commit 24dc5c6

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

github-packages/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FROM alpine:3.14
2+
CMD echo "Hello World!"

github-packages/Readme.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
EXPORT GH_USERNAME='freethinker78'
2+
export GH_TOKEN=''
3+
export GH_IMAGE_NAME='hello-world'
4+
export GH_VER='1.0.0'
5+
6+
env | grep GH_
7+
GH_TOKEN=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
8+
GH_IMAGE_NAME=hello-world
9+
GH_USERNAME=FreeThinker78
10+
GH_VER=1.0.0
11+
12+
13+
echo $GH_TOKEN | docker login ghcr.io -u $GH_USERNAME --password-stdin
14+
15+
WARNING! Your password will be stored unencrypted in /home/codespace/.docker/config.json.
16+
Configure a credential helper to remove this warning. See
17+
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
18+
19+
Login Succeeded
20+
21+
docker tag $IMAGE_NAME:$GH_VER ghcr.io/$GH_USERNAME/$IMAGE_NAME:$GH_VER
22+
23+
Error parsing reference: "ghcr.io/FreeThinker78/hello-world:1.0.0" is not a valid repository/tag: invalid reference format: repository name (FreeThinker78/hello-world) must be lowercase
24+
25+
docker images
26+
REPOSITORY TAG IMAGE ID CREATED SIZE
27+
hello-world latest 6fa7e980050d 12 minutes ago 5.61MB
28+
alpine 3.14 9e179bacf43c 14 months ago 5.61MB
29+
30+
docker tag $IMAGE_NAME:latest ghcr.io/$GH_USERNAME/$IMAGE_NAME:$GH_VER
31+
32+
docker push ghcr.io/$GH_USERNAME/$GH_IMAGE_NAME:$GH_VER
33+
34+
The push refers to repository [ghcr.io/freethinker78/hello-world]
35+
9733ccc39513: Pushed
36+
1.0.0: digest: sha256:0795a7f21db81d82b8da0d847f058b8cb4a1759a8fe924eedd8dfa57b2b77af1 size: 528
37+
38+
39+
LABEL org.opencontainers.image.source https://github.com/OWNER/REPO

0 commit comments

Comments
 (0)