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