chore: Clean up docker builds, support attestation with provinence and sboms
This commit is contained in:
parent
321e8f9cb2
commit
5b9f2beccd
|
|
@ -74,7 +74,8 @@ archives:
|
||||||
- config.yaml
|
- config.yaml
|
||||||
- LICENSE
|
- LICENSE
|
||||||
- README.md
|
- README.md
|
||||||
- Dockerfile
|
- src: Dockerfile.singlearch
|
||||||
|
dst: Dockerfile
|
||||||
- webui
|
- webui
|
||||||
- ./var/
|
- ./var/
|
||||||
name_template: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}{{ .Arm }}"
|
name_template: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}{{ .Arm }}"
|
||||||
|
|
@ -83,73 +84,29 @@ archives:
|
||||||
- goos: windows
|
- goos: windows
|
||||||
formats: zip
|
formats: zip
|
||||||
|
|
||||||
dockers:
|
# dockers_v2: single multi-platform build with buildx; keeps default provenance + SBOM.
|
||||||
- image_templates:
|
# Replaces legacy dockers + docker_manifests (avoids "is a manifest list" when attestations are on).
|
||||||
- "docker.io/jamesread/olivetin:{{ .Tag }}-amd64"
|
dockers_v2:
|
||||||
- "ghcr.io/olivetin/olivetin:{{ .Tag }}-amd64"
|
- dockerfile: Dockerfile.multiarches
|
||||||
dockerfile: Dockerfile
|
images:
|
||||||
goos: linux
|
- docker.io/jamesread/olivetin
|
||||||
goarch: amd64
|
- ghcr.io/olivetin/olivetin
|
||||||
skip_push: false
|
tags:
|
||||||
build_flag_templates:
|
- "{{ .Tag }}"
|
||||||
- "--platform=linux/amd64"
|
- latest
|
||||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
- latest-3k
|
||||||
- "--label=org.opencontainers.image.version={{.Tag}}"
|
platforms:
|
||||||
|
- linux/amd64
|
||||||
|
- linux/arm64
|
||||||
extra_files:
|
extra_files:
|
||||||
- webui/
|
- webui/
|
||||||
- var/entities/
|
- var/entities/
|
||||||
- config.yaml
|
- config.yaml
|
||||||
- var/helper-actions/
|
- var/helper-actions/
|
||||||
|
labels:
|
||||||
- image_templates:
|
org.opencontainers.image.revision: "{{ .FullCommit }}"
|
||||||
- "docker.io/jamesread/olivetin:{{ .Tag }}-arm64"
|
org.opencontainers.image.version: "{{ .Tag }}"
|
||||||
- "ghcr.io/olivetin/olivetin:{{ .Tag }}-arm64"
|
sbom: true
|
||||||
dockerfile: Dockerfile.arm64
|
|
||||||
goos: linux
|
|
||||||
goarch: arm64
|
|
||||||
skip_push: false
|
|
||||||
build_flag_templates:
|
|
||||||
- "--platform=linux/arm64"
|
|
||||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
|
||||||
- "--label=org.opencontainers.image.version={{.Tag}}"
|
|
||||||
extra_files:
|
|
||||||
- webui/
|
|
||||||
- var/entities/
|
|
||||||
- config.yaml
|
|
||||||
- var/helper-actions/
|
|
||||||
|
|
||||||
docker_manifests:
|
|
||||||
- name_template: docker.io/jamesread/olivetin:{{ .Version }}
|
|
||||||
image_templates:
|
|
||||||
- docker.io/jamesread/olivetin:{{ .Version }}-amd64
|
|
||||||
- docker.io/jamesread/olivetin:{{ .Version }}-arm64
|
|
||||||
|
|
||||||
- name_template: docker.io/jamesread/olivetin:latest
|
|
||||||
image_templates:
|
|
||||||
- docker.io/jamesread/olivetin:{{ .Version }}-amd64
|
|
||||||
- docker.io/jamesread/olivetin:{{ .Version }}-arm64
|
|
||||||
|
|
||||||
- name_template: docker.io/jamesread/olivetin:latest-3k
|
|
||||||
image_templates:
|
|
||||||
- docker.io/jamesread/olivetin:{{ .Version }}-amd64
|
|
||||||
- docker.io/jamesread/olivetin:{{ .Version }}-arm64
|
|
||||||
|
|
||||||
|
|
||||||
- name_template: ghcr.io/olivetin/olivetin:{{ .Version }}
|
|
||||||
image_templates:
|
|
||||||
- ghcr.io/olivetin/olivetin:{{ .Version }}-amd64
|
|
||||||
- ghcr.io/olivetin/olivetin:{{ .Version }}-arm64
|
|
||||||
|
|
||||||
- name_template: ghcr.io/olivetin/olivetin:latest
|
|
||||||
image_templates:
|
|
||||||
- ghcr.io/olivetin/olivetin:{{ .Version }}-amd64
|
|
||||||
- ghcr.io/olivetin/olivetin:{{ .Version }}-arm64
|
|
||||||
|
|
||||||
- name_template: ghcr.io/olivetin/olivetin:latest-3k
|
|
||||||
image_templates:
|
|
||||||
- ghcr.io/olivetin/olivetin:{{ .Version }}-amd64
|
|
||||||
- ghcr.io/olivetin/olivetin:{{ .Version }}-arm64
|
|
||||||
|
|
||||||
|
|
||||||
nfpms:
|
nfpms:
|
||||||
- id: default
|
- id: default
|
||||||
|
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
FROM --platform=linux/armhfp registry.fedoraproject.org/fedora-minimal:36-armhfp
|
|
||||||
|
|
||||||
LABEL org.opencontainers.image.source https://github.com/OliveTin/OliveTin
|
|
||||||
LABEL org.opencontainers.image.title=OliveTin
|
|
||||||
|
|
||||||
RUN mkdir -p /config /config/entities /var/www/olivetin \
|
|
||||||
&& \
|
|
||||||
microdnf install -y --nodocs --noplugins --setopt=keepcache=0 --setopt=install_weak_deps=0 \
|
|
||||||
iputils \
|
|
||||||
shadow-utils \
|
|
||||||
openssh-clients
|
|
||||||
|
|
||||||
RUN useradd --system --create-home olivetin -u 1000
|
|
||||||
|
|
||||||
EXPOSE 1337/tcp
|
|
||||||
|
|
||||||
COPY config.yaml /config
|
|
||||||
COPY var/entities/* /config/entities/
|
|
||||||
VOLUME /config
|
|
||||||
|
|
||||||
COPY OliveTin /usr/bin/OliveTin
|
|
||||||
COPY webui /var/www/olivetin/
|
|
||||||
COPY var/helper-actions/* /usr/bin/
|
|
||||||
|
|
||||||
USER olivetin
|
|
||||||
|
|
||||||
ENTRYPOINT [ "/usr/bin/OliveTin" ]
|
|
||||||
|
|
@ -1,10 +1,17 @@
|
||||||
FROM --platform=linux/arm64 registry.fedoraproject.org/fedora-minimal:42-aarch64 AS olivetin-tmputils
|
# Multi-arch Dockerfile for GoReleaser (dockers_v2).
|
||||||
|
# Base image :43 is used without arch suffix so the registry can supply the right
|
||||||
|
# platform (manifest list). TARGETPLATFORM is set by BuildKit for COPY.
|
||||||
|
# For custom/local single-arch builds, use Dockerfile.singlearch instead.
|
||||||
|
|
||||||
|
ARG TARGETPLATFORM
|
||||||
|
|
||||||
|
FROM registry.fedoraproject.org/fedora-minimal:43 AS olivetin-tmputils
|
||||||
|
|
||||||
RUN microdnf -y install dnf-plugins-core && \
|
RUN microdnf -y install dnf-plugins-core && \
|
||||||
dnf-3 config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo && \
|
dnf-3 config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo && \
|
||||||
microdnf install -y docker-ce-cli docker-compose-plugin && microdnf clean all
|
microdnf install -y docker-ce-cli docker-compose-plugin && microdnf clean all
|
||||||
|
|
||||||
FROM --platform=linux/arm64 registry.fedoraproject.org/fedora-minimal:42-aarch64
|
FROM registry.fedoraproject.org/fedora-minimal:43
|
||||||
|
|
||||||
LABEL org.opencontainers.image.source https://github.com/OliveTin/OliveTin
|
LABEL org.opencontainers.image.source https://github.com/OliveTin/OliveTin
|
||||||
LABEL org.opencontainers.image.title OliveTin
|
LABEL org.opencontainers.image.title OliveTin
|
||||||
|
|
@ -37,7 +44,8 @@ COPY config.yaml /config
|
||||||
COPY var/entities/* /config/entities/
|
COPY var/entities/* /config/entities/
|
||||||
VOLUME /config
|
VOLUME /config
|
||||||
|
|
||||||
COPY OliveTin /usr/bin/OliveTin
|
ARG TARGETPLATFORM
|
||||||
|
COPY $TARGETPLATFORM/OliveTin /usr/bin/OliveTin
|
||||||
COPY webui /var/www/olivetin/
|
COPY webui /var/www/olivetin/
|
||||||
COPY var/helper-actions/* /usr/bin/
|
COPY var/helper-actions/* /usr/bin/
|
||||||
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
FROM --platform=linux/amd64 registry.fedoraproject.org/fedora-minimal:42-x86_64 AS olivetin-tmputils
|
FROM --platform=linux/amd64 registry.fedoraproject.org/fedora-minimal:43-x86_64 AS olivetin-tmputils
|
||||||
|
|
||||||
RUN microdnf -y install dnf-plugins-core && \
|
RUN microdnf -y install dnf-plugins-core && \
|
||||||
dnf-3 config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo && \
|
dnf-3 config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo && \
|
||||||
microdnf install -y docker-ce-cli docker-compose-plugin && microdnf clean all
|
microdnf install -y docker-ce-cli docker-compose-plugin && microdnf clean all
|
||||||
|
|
||||||
FROM --platform=linux/amd64 registry.fedoraproject.org/fedora-minimal:42-x86_64
|
FROM --platform=linux/amd64 registry.fedoraproject.org/fedora-minimal:43-x86_64
|
||||||
|
|
||||||
LABEL org.opencontainers.image.source https://github.com/OliveTin/OliveTin
|
LABEL org.opencontainers.image.source https://github.com/OliveTin/OliveTin
|
||||||
LABEL org.opencontainers.image.title OliveTin
|
LABEL org.opencontainers.image.title OliveTin
|
||||||
4
Makefile
4
Makefile
|
|
@ -31,7 +31,7 @@ dist:
|
||||||
|
|
||||||
|
|
||||||
podman-image:
|
podman-image:
|
||||||
buildah bud -t olivetin
|
buildah bud -f Dockerfile.singlearch -t olivetin
|
||||||
|
|
||||||
podman-container:
|
podman-container:
|
||||||
podman kill olivetin || true
|
podman kill olivetin || true
|
||||||
|
|
@ -41,7 +41,7 @@ podman-container:
|
||||||
|
|
||||||
integration-tests-docker-image:
|
integration-tests-docker-image:
|
||||||
docker rm -f olivetin && docker rmi -f olivetin
|
docker rm -f olivetin && docker rmi -f olivetin
|
||||||
docker build -t olivetin:latest .
|
docker build -f Dockerfile.singlearch -t olivetin:latest .
|
||||||
docker create --name olivetin -p 1337:1337 -v `pwd`/integration-tests/configs/:/config/ olivetin
|
docker create --name olivetin -p 1337:1337 -v `pwd`/integration-tests/configs/:/config/ olivetin
|
||||||
|
|
||||||
devrun: compile
|
devrun: compile
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue