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:
|
commands:
|
||||||
- |
|
- |
|
||||||
echo "=== Building amd64 image ==="
|
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 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:amd64
|
||||||
|
docker push $REGISTRY_URL/public/portainer-agent-tailscale:$IMAGE_TAG-amd64
|
||||||
|
|
||||||
- name: build-arm64
|
- name: build-arm64
|
||||||
image: docker:26
|
image: docker:26
|
||||||
@@ -39,9 +43,13 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- |
|
- |
|
||||||
echo "=== Building arm64 image ==="
|
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 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:arm64
|
||||||
|
docker push $REGISTRY_URL/public/portainer-agent-tailscale:$IMAGE_TAG-arm64
|
||||||
|
|
||||||
- name: create-manifest
|
- name: create-manifest
|
||||||
image: docker:26
|
image: docker:26
|
||||||
@@ -59,32 +67,19 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- |
|
- |
|
||||||
echo "=== Creating multi-arch manifest ==="
|
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 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 \
|
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:amd64 \
|
||||||
--amend $REGISTRY_URL/public/portainer-agent-tailscale:arm64
|
--amend $REGISTRY_URL/public/portainer-agent-tailscale:arm64
|
||||||
docker manifest push $REGISTRY_URL/public/portainer-agent-tailscale:latest
|
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:
|
volumes:
|
||||||
- name: docker_sock
|
- name: docker_sock
|
||||||
|
|||||||
15
Dockerfile
15
Dockerfile
@@ -8,29 +8,30 @@ FROM tailscale/tailscale:latest AS tailscale
|
|||||||
FROM alpine:3.20
|
FROM alpine:3.20
|
||||||
|
|
||||||
# Basis-Pakete
|
# Basis-Pakete
|
||||||
RUN apk add --no-cache \
|
RUN apk add update \
|
||||||
iptables \
|
iptables \
|
||||||
iproute2 \
|
iproute2 \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
curl \
|
curl \
|
||||||
bash \
|
bash \
|
||||||
tini
|
tini \
|
||||||
|
&& rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
# Binaries von Tailscale kopieren
|
# Binaries von Tailscale kopieren
|
||||||
COPY --from=tailscale /usr/local/bin/tailscaled /usr/local/bin/tailscaled
|
COPY --from=tailscale /usr/local/bin/tailscaled /usr/local/bin/tailscaled
|
||||||
COPY --from=tailscale /usr/local/bin/tailscale /usr/local/bin/tailscale
|
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
|
COPY --from=agent /app /app
|
||||||
|
|
||||||
# Arbeitsverzeichnis
|
# Arbeitsverzeichnis
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Startskript hinzufügen
|
# Startskript hinzufügen
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
# TUN-Gerät vorbereiten
|
# TUN-Gerät vorbereiten
|
||||||
RUN mkdir -p /dev/net
|
RUN mkdir -p /dev/net
|
||||||
VOLUME ["/var/lib/tailscale"]
|
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.description="Tailscale-fähiger Portainer-Agent für ARM64/AMD64"
|
||||||
LABEL org.opencontainers.image.version="1.0.0"
|
LABEL org.opencontainers.image.version="1.0.0"
|
||||||
LABEL org.opencontainers.image.authors="Patrick Buchhorst <patrick@buchhorster.de>"
|
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.licenses="MIT"
|
||||||
LABEL org.opencontainers.image.vendor="Buchhorster IT"
|
LABEL org.opencontainers.image.vendor="Buchhorster IT"
|
||||||
|
LABEL org.opencontainers.image.os="linux"
|
||||||
|
|
||||||
ENTRYPOINT ["/sbin/tini", "--"]
|
ENTRYPOINT ["/sbin/tini", "--"]
|
||||||
CMD ["/entrypoint.sh"]
|
CMD ["/entrypoint.sh"]
|
||||||
|
|||||||
Reference in New Issue
Block a user