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
Update publish.yml
knotbin.com
6 months ago
3e619dfa
08cb767c
0/1
publish.yml
failed
2s
+16
-31
1 changed file
expand all
collapse all
unified
split
.tangled
workflows
publish.yml
+16
-31
.tangled/workflows/publish.yml
···
91
91
# Add healthcheck (as a script since buildah doesn't support healthcheck directly)
92
92
buildah run $container -- sh -c 'echo "#!/bin/sh\ncurl -f http://localhost:5555 || exit 1" > /usr/bin/healthcheck && chmod +x /usr/bin/healthcheck'
93
93
94
94
-
# Commit the container to an image
95
95
-
buildah commit $container localhost/$DOCKER_USERNAME/$DOCKER_REPO:$TAG
96
96
-
buildah tag localhost/$DOCKER_USERNAME/$DOCKER_REPO:$TAG localhost/$DOCKER_USERNAME/$DOCKER_REPO:latest
94
94
+
# Export directly from container instead of committing to avoid storage issues
95
95
+
echo "Exporting container directly to archives..."
96
96
+
buildah push $container docker-archive:image-$TAG.tar || {
97
97
+
echo "Failed to export $TAG image from container"
98
98
+
exit 1
99
99
+
}
100
100
+
101
101
+
# Create latest archive as copy of tagged archive
102
102
+
cp image-$TAG.tar image-latest.tar
97
103
98
104
# Clean up
99
105
buildah rm $container
100
106
101
101
-
echo "Image built successfully: $DOCKER_USERNAME/$DOCKER_REPO:$TAG"
107
107
+
echo "Image exported successfully to archives"
102
108
103
109
- name: "Convert buildah image to Docker format and push"
104
110
command: |
···
140
146
EOF
141
147
cp ~/.config/containers/policy.json /etc/containers/policy.json 2>/dev/null || true
142
148
143
143
-
# Debug: Check what images buildah actually created
144
144
-
echo "Debug: Available buildah images:"
145
145
-
buildah images
146
146
-
147
149
# Debug: Check credentials are set
148
150
echo "Debug: DOCKER_USERNAME is set: $([ -n "$DOCKER_USERNAME" ] && echo "YES" || echo "NO")"
149
151
echo "Debug: DOCKER_PASSWORD is set: $([ -n "$DOCKER_PASSWORD" ] && echo "YES" || echo "NO")"
150
152
echo "Debug: DOCKER_USERNAME value: $DOCKER_USERNAME"
151
153
echo "Debug: Password length: ${#DOCKER_PASSWORD}"
152
154
153
153
-
# Export buildah image to docker format with error checking
154
154
-
echo "Exporting $TAG image..."
155
155
-
if ! buildah push localhost/$DOCKER_USERNAME/$DOCKER_REPO:$TAG docker-archive:image-$TAG.tar; then
156
156
-
echo "Failed with localhost prefix, trying without..."
157
157
-
if ! buildah push $DOCKER_USERNAME/$DOCKER_REPO:$TAG docker-archive:image-$TAG.tar; then
158
158
-
echo "Both image export attempts failed, listing available images:"
159
159
-
buildah images
160
160
-
exit 1
161
161
-
fi
162
162
-
fi
163
163
-
164
164
-
echo "Exporting latest image..."
165
165
-
if ! buildah push localhost/$DOCKER_USERNAME/$DOCKER_REPO:latest docker-archive:image-latest.tar; then
166
166
-
echo "Failed with localhost prefix, trying without..."
167
167
-
if ! buildah push $DOCKER_USERNAME/$DOCKER_REPO:latest docker-archive:image-latest.tar; then
168
168
-
echo "Both latest export attempts failed"
169
169
-
exit 1
170
170
-
fi
171
171
-
fi
172
172
-
173
173
-
# Check if archives were created
155
155
+
# Check if archives were created in the build step
174
156
echo "Debug: Checking created archives..."
175
175
-
ls -la image-*.tar 2>/dev/null || echo "No archive files found"
157
157
+
ls -la image-*.tar || {
158
158
+
echo "ERROR: Archive files not found - build step failed"
159
159
+
exit 1
160
160
+
}
176
161
echo "Debug: Archive sizes:"
177
177
-
du -h image-*.tar 2>/dev/null || echo "No archive files to measure"
162
162
+
du -h image-*.tar
178
163
179
164
# Use skopeo to push to Docker Hub with proper login
180
165
echo "Logging in to Docker Hub..."