tangled
alpha
login
or
join now
tangled.org
/
knot-docker
89
fork
atom
Community maintained Docker config for the knot server
89
fork
atom
overview
issues
3
pulls
1
pipelines
skepeo
knotbin.com
6 months ago
158f2271
fcd5bbc9
1/1
publish.yml
success
4s
+16
-5
1 changed file
expand all
collapse all
unified
split
.tangled
workflows
publish.yml
+16
-5
.tangled/workflows/publish.yml
···
47
47
48
48
echo "Building image with buildah for TAG: $TAG"
49
49
50
50
+
# Suppress buildah user warnings in CI environment
51
51
+
export BUILDAH_ISOLATION=chroot
52
52
+
export XDG_RUNTIME_DIR=/tmp/buildah-runtime
53
53
+
mkdir -p $XDG_RUNTIME_DIR
54
54
+
50
55
# Create a new container from alpine
51
56
container=$(buildah from alpine:edge)
52
57
···
95
100
96
101
echo "Image built successfully: $DOCKER_USERNAME/$DOCKER_REPO:$TAG"
97
102
98
98
-
- name: "Push Docker image to registry"
103
103
+
- name: "Convert buildah image to Docker format and push"
99
104
command: |
100
105
# Source the environment
101
106
source ~/.bashrc || true
···
113
118
exit 1
114
119
fi
115
120
121
121
+
# Export buildah image to docker format
122
122
+
buildah push localhost/$DOCKER_USERNAME/$DOCKER_REPO:$TAG docker-archive:image-$TAG.tar
123
123
+
buildah push localhost/$DOCKER_USERNAME/$DOCKER_REPO:latest docker-archive:image-latest.tar
124
124
+
125
125
+
# Use skopeo to push to Docker Hub with proper login
126
126
+
echo "Logging in to Docker Hub..."
127
127
+
echo "$DOCKER_PASSWORD" | skopeo login docker.io -u "$DOCKER_USERNAME" --password-stdin
128
128
+
116
129
echo "Pushing image: $DOCKER_USERNAME/$DOCKER_REPO:$TAG"
117
130
118
131
# Push the tagged image
119
132
skopeo copy \
120
120
-
--dest-creds="$DOCKER_USERNAME:$DOCKER_PASSWORD" \
121
121
-
containers-storage:localhost/$DOCKER_USERNAME/$DOCKER_REPO:$TAG \
133
133
+
docker-archive:image-$TAG.tar \
122
134
docker://docker.io/$DOCKER_USERNAME/$DOCKER_REPO:$TAG
123
135
124
136
# Push as latest
125
137
skopeo copy \
126
126
-
--dest-creds="$DOCKER_USERNAME:$DOCKER_PASSWORD" \
127
127
-
containers-storage:localhost/$DOCKER_USERNAME/$DOCKER_REPO:latest \
138
138
+
docker-archive:image-latest.tar \
128
139
docker://docker.io/$DOCKER_USERNAME/$DOCKER_REPO:latest
129
140
130
141
echo "Successfully pushed both $TAG and latest tags"