Update Dockerfile + drone build image with drone buildnumber
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
39
.drone.yml
39
.drone.yml
@@ -19,9 +19,13 @@ steps:
|
||||
commands:
|
||||
- |
|
||||
echo "=== Building amd64 image ==="
|
||||
export IMAGE_TAG=$DRONE_BUILD_NUMBER
|
||||
echo "Using tag: $IMAGE_TAG"
|
||||
docker login "$REGISTRY_URL" -u "$DOCKER_USER" -p "$DOCKER_PASS"
|
||||
docker build -t $REGISTRY_URL/public/portainer-agent-tailscale:amd64 .
|
||||
docker build -t $REGISTRY_URL/public/portainer-agent-tailscale:amd64 \
|
||||
-t $REGISTRY_URL/public/portainer-agent-tailscale:$IMAGE_TAG-amd64 .
|
||||
docker push $REGISTRY_URL/public/portainer-agent-tailscale:amd64
|
||||
docker push $REGISTRY_URL/public/portainer-agent-tailscale:$IMAGE_TAG-amd64
|
||||
|
||||
- name: build-arm64
|
||||
image: docker:26
|
||||
@@ -39,9 +43,13 @@ steps:
|
||||
commands:
|
||||
- |
|
||||
echo "=== Building arm64 image ==="
|
||||
export IMAGE_TAG=$DRONE_BUILD_NUMBER
|
||||
echo "Using tag: $IMAGE_TAG"
|
||||
docker login "$REGISTRY_URL" -u "$DOCKER_USER" -p "$DOCKER_PASS"
|
||||
docker build -t $REGISTRY_URL/public/portainer-agent-tailscale:arm64 .
|
||||
docker build -t $REGISTRY_URL/public/portainer-agent-tailscale:arm64 \
|
||||
-t $REGISTRY_URL/public/portainer-agent-tailscale:$IMAGE_TAG-arm64 .
|
||||
docker push $REGISTRY_URL/public/portainer-agent-tailscale:arm64
|
||||
docker push $REGISTRY_URL/public/portainer-agent-tailscale:$IMAGE_TAG-arm64
|
||||
|
||||
- name: create-manifest
|
||||
image: docker:26
|
||||
@@ -59,32 +67,19 @@ steps:
|
||||
commands:
|
||||
- |
|
||||
echo "=== Creating multi-arch manifest ==="
|
||||
export IMAGE_TAG=$DRONE_BUILD_NUMBER
|
||||
echo "Using tag: $IMAGE_TAG"
|
||||
docker login "$REGISTRY_URL" -u "$DOCKER_USER" -p "$DOCKER_PASS"
|
||||
docker manifest create $REGISTRY_URL/public/portainer-agent-tailscale:$IMAGE_TAG \
|
||||
--amend $REGISTRY_URL/public/portainer-agent-tailscale:$IMAGE_TAG-amd64 \
|
||||
--amend $REGISTRY_URL/public/portainer-agent-tailscale:$IMAGE_TAG-arm64
|
||||
docker manifest push $REGISTRY_URL/public/portainer-agent-tailscale:$IMAGE_TAG
|
||||
|
||||
docker manifest create $REGISTRY_URL/public/portainer-agent-tailscale:latest \
|
||||
--amend $REGISTRY_URL/public/portainer-agent-tailscale:amd64 \
|
||||
--amend $REGISTRY_URL/public/portainer-agent-tailscale:arm64
|
||||
docker manifest push $REGISTRY_URL/public/portainer-agent-tailscale:latest
|
||||
|
||||
- name: trigger-zot-refresh-and-cve-scan
|
||||
image: curlimages/curl:8.10.1
|
||||
environment:
|
||||
ZOT_USER:
|
||||
from_secret: ZOT_USER
|
||||
ZOT_PASS:
|
||||
from_secret: ZOT_PASS
|
||||
REGISTRY_URL:
|
||||
from_secret: REGISTRY_URL
|
||||
commands:
|
||||
- |
|
||||
echo "Triggering Zot metadata refresh..."
|
||||
curl -u "$DOCKER_USER:$DOCKER__PASS" -X POST "$REGISTRY_URL/v2/_zot/ext/refresh"
|
||||
|
||||
echo "Triggering CVE scan..."
|
||||
curl -u "$DOCKER_USER:$DOCKER_PASS" -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
"$REGISTRY_URL/v2/_zot/ext/cve/scan" \
|
||||
-d '{"repo":"public/portainer-agent-tailscale"}'
|
||||
|
||||
|
||||
volumes:
|
||||
- name: docker_sock
|
||||
|
||||
15
Dockerfile
15
Dockerfile
@@ -8,29 +8,30 @@ FROM tailscale/tailscale:latest AS tailscale
|
||||
FROM alpine:3.20
|
||||
|
||||
# Basis-Pakete
|
||||
RUN apk add --no-cache \
|
||||
RUN apk add update \
|
||||
iptables \
|
||||
iproute2 \
|
||||
ca-certificates \
|
||||
curl \
|
||||
bash \
|
||||
tini
|
||||
tini \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
# Binaries von Tailscale kopieren
|
||||
COPY --from=tailscale /usr/local/bin/tailscaled /usr/local/bin/tailscaled
|
||||
COPY --from=tailscale /usr/local/bin/tailscale /usr/local/bin/tailscale
|
||||
|
||||
# Komplette Portainer-Agent-App übernehmen
|
||||
# Komplette Portainer-Agent-App übernehmen
|
||||
COPY --from=agent /app /app
|
||||
|
||||
# Arbeitsverzeichnis
|
||||
WORKDIR /app
|
||||
|
||||
# Startskript hinzufügen
|
||||
# Startskript hinzufügen
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
# TUN-Gerät vorbereiten
|
||||
# TUN-Gerät vorbereiten
|
||||
RUN mkdir -p /dev/net
|
||||
VOLUME ["/var/lib/tailscale"]
|
||||
|
||||
@@ -41,10 +42,10 @@ LABEL org.opencontainers.image.title="Portainer Agent Tailscale"
|
||||
LABEL org.opencontainers.image.description="Tailscale-fähiger Portainer-Agent für ARM64/AMD64"
|
||||
LABEL org.opencontainers.image.version="1.0.0"
|
||||
LABEL org.opencontainers.image.authors="Patrick Buchhorst <patrick@buchhorster.de>"
|
||||
LABEL org.opencontainers.image.source="https://gitea.buchhorster.de/portainer-agent-tailscale"
|
||||
LABEL org.opencontainers.image.source="https://gitea.buchhorster.de/patrick/portainer-agent-tailscale"
|
||||
LABEL org.opencontainers.image.licenses="MIT"
|
||||
LABEL org.opencontainers.image.vendor="Buchhorster IT"
|
||||
|
||||
LABEL org.opencontainers.image.os="linux"
|
||||
|
||||
ENTRYPOINT ["/sbin/tini", "--"]
|
||||
CMD ["/entrypoint.sh"]
|
||||
|
||||
Reference in New Issue
Block a user