Skip to content

Commit

Permalink
More crazy functions
Browse files Browse the repository at this point in the history
  • Loading branch information
greboid committed Oct 14, 2023
1 parent c01f5a6 commit 3d19b18
Show file tree
Hide file tree
Showing 31 changed files with 288 additions and 336 deletions.
6 changes: 3 additions & 3 deletions alpine/Containerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Generated from https://github.com/greboid/dockerfiles/blob/master/alpine/Containerfile.gotpl
# BOM: {"alpine":"3.18.3"}
# BOM: {"alpine":"3.18.4"}

FROM reg.g5d.dev/alpine AS verify

ARG ARCHIVE_URL="https://mirrors.melbourne.co.uk/alpine/latest-stable/releases/x86_64/alpine-minirootfs-3.18.3-x86_64.tar.gz"
ARG ARCHIVE_SUM="fc577324b7e9439863118c7e5209d25d7eddea6ba62b58badbc33c96861b9c4e"
ARG ARCHIVE_URL="https://mirrors.melbourne.co.uk/alpine/latest-stable/releases/x86_64/alpine-minirootfs-3.18.4-x86_64.tar.gz"
ARG ARCHIVE_SUM="c59d5203bc6b8b6ef81f3f6b63e32c28d6e47be806ba8528f8766a4ca506c7ba"

RUN apk add --no-cache curl
RUN curl -sfLo fs.tar.gz $ARCHIVE_URL; \
Expand Down
10 changes: 5 additions & 5 deletions baseroot/Containerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Generated from https://github.com/greboid/dockerfiles/blob/master/baseroot/Containerfile.gotpl
# BOM: {"apk:ca-certificates-bundle":"20230506-r0","apk:libacl":"2.3.1-r3","apk:libxxhash":"0.8.2-r0","apk:lz4-libs":"1.9.4-r4","apk:musl":"1.2.4-r1","apk:popt":"1.19-r2","apk:rsync":"3.2.7-r4","apk:tzdata":"2023c-r1","apk:zlib":"1.2.13-r1","apk:zstd-libs":"1.5.5-r4","image:alpine":"f7601e006c52c627a3f5501f404c6868fdf38308ad460fba97b7845aa2d7dd50"}
# BOM: {"apk:ca-certificates-bundle":"20230506-r0","apk:libacl":"2.3.1-r3","apk:libxxhash":"0.8.2-r0","apk:lz4-libs":"1.9.4-r4","apk:musl":"1.2.4-r2","apk:popt":"1.19-r2","apk:rsync":"3.2.7-r4","apk:tzdata":"2023c-r1","apk:zlib":"1.2.13-r1","apk:zstd-libs":"1.5.5-r4","image:alpine":"e2b43fe31f5609bc07265b709d41d65dcff433da4e96504e41fbd54861d393f9"}

FROM reg.g5d.dev/alpine@sha256:f7601e006c52c627a3f5501f404c6868fdf38308ad460fba97b7845aa2d7dd50 AS build
FROM reg.g5d.dev/alpine@sha256:e2b43fe31f5609bc07265b709d41d65dcff433da4e96504e41fbd54861d393f9 AS build

RUN set -eux; \
#Install build dependencies
apk add --no-cache \libacl=2.3.1-r3 \
libxxhash=0.8.2-r0 \
lz4-libs=1.9.4-r4 \
musl=1.2.4-r1 \
musl=1.2.4-r2 \
popt=1.19-r2 \
rsync=3.2.7-r4 \
zlib=1.2.13-r1 \
Expand All @@ -20,15 +20,15 @@ RUN set -eux; \
apk add --no-cache \libacl=2.3.1-r3 \
libxxhash=0.8.2-r0 \
lz4-libs=1.9.4-r4 \
musl=1.2.4-r1 \
musl=1.2.4-r2 \
popt=1.19-r2 \
rsync=3.2.7-r4 \
zlib=1.2.13-r1 \
zstd-libs=1.5.5-r4; \
# Add packages into the runtime fs
apk add --no-cache ca-certificates-bundle=20230506-r0; \
apk info -qL ca-certificates-bundle | rsync -aq --files-from=- / /rootfs/; \
apk add --no-cache musl=1.2.4-r1; \
apk add --no-cache musl=1.2.4-r2; \
apk info -qL musl | rsync -aq --files-from=- / /rootfs/; \
apk add --no-cache tzdata=2023c-r1; \
apk info -qL tzdata | rsync -aq --files-from=- / /rootfs/
Expand Down
59 changes: 28 additions & 31 deletions centauri/Containerfile
Original file line number Diff line number Diff line change
@@ -1,43 +1,40 @@
# Generated from https://github.com/greboid/dockerfiles/blob/master/centauri/Containerfile.gotpl
# BOM: {"apk:brotli-libs":"1.0.9-r14","apk:busybox":"1.36.1-r2","apk:busybox-binsh":"1.36.1-r2","apk:ca-certificates":"20230506-r0","apk:git":"2.40.1-r0","apk:libcrypto3":"3.1.2-r0","apk:libcurl":"8.2.1-r0","apk:libexpat":"2.5.0-r1","apk:libidn2":"2.3.4-r1","apk:libssl3":"3.1.2-r0","apk:libunistring":"1.1-r1","apk:musl":"1.2.4-r1","apk:nghttp2-libs":"1.55.1-r0","apk:pcre2":"10.42-r1","apk:zlib":"1.2.13-r1","github:csmith/centauri":"v0.3.0","image:base":"2efe0a4732e281176d0871d4e9db4d143156289192887a056d3eddd91d02d096","image:golang":"ada25feadcd2358de8ef4f8fba32c5cd074439dea37ec7b34495738bb9882640"}
# BOM: {"apk:brotli-libs":"1.0.9-r14","apk:busybox":"1.36.1-r2","apk:busybox-binsh":"1.36.1-r2","apk:ca-certificates":"20230506-r0","apk:git":"2.40.1-r0","apk:libcrypto3":"3.1.2-r0","apk:libcurl":"8.2.1-r0","apk:libexpat":"2.5.0-r1","apk:libidn2":"2.3.4-r1","apk:libssl3":"3.1.2-r0","apk:libunistring":"1.1-r1","apk:musl":"1.2.4-r1","apk:nghttp2-libs":"1.55.1-r0","apk:pcre2":"10.42-r1","apk:zlib":"1.2.13-r1","github:csmith/centauri":"v0.4.1","image:base":"2efe0a4732e281176d0871d4e9db4d143156289192887a056d3eddd91d02d096","image:golang":"1e89b999fbe8fac8ddac0ca839f89778d6b72bebcc4f6f03676f445c65cccf7e"}

FROM reg.g5d.dev/golang@sha256:ada25feadcd2358de8ef4f8fba32c5cd074439dea37ec7b34495738bb9882640 AS build
FROM reg.g5d.dev/golang@sha256:1e89b999fbe8fac8ddac0ca839f89778d6b72bebcc4f6f03676f445c65cccf7e AS build
#Create required volumes
RUN mkdir -p \
/rootfs/home/nonroot/.config \
/rootfs/data

#Ensure git is installed
RUN set -eux; \
#Create required directories
mkdir -p \
/rootfs/home/nonroot/.config\
/rootfs/data

ARG TAGcentauri="v0.3.0"
RUN set -eux; \
#Ensure git is in the build environment
apk add --no-cache \
brotli-libs=1.0.9-r14 \
busybox=1.36.1-r2 \
busybox-binsh=1.36.1-r2 \
ca-certificates=20230506-r0 \
git=2.40.1-r0 \
libcrypto3=3.1.2-r0 \
libcurl=8.2.1-r0 \
libexpat=2.5.0-r1 \
libidn2=2.3.4-r1 \
libssl3=3.1.2-r0 \
libunistring=1.1-r1 \
musl=1.2.4-r1 \
nghttp2-libs=1.55.1-r0 \
pcre2=10.42-r1 \
zlib=1.2.13-r1

RUN git clone --depth=1 -b $TAGcentauri --single-branch https://github.com/csmith/centauri /src/csmith/centauri
apk add --no-cache \
pcre2=10.42-r1 \
zlib=1.2.13-r1 \
libidn2=2.3.4-r1 \
busybox-binsh=1.36.1-r2 \
busybox=1.36.1-r2 \
git=2.40.1-r0 \
libcurl=8.2.1-r0 \
musl=1.2.4-r1 \
brotli-libs=1.0.9-r14 \
libcrypto3=3.1.2-r0 \
nghttp2-libs=1.55.1-r0 \
libssl3=3.1.2-r0 \
libexpat=2.5.0-r1 \
ca-certificates=20230506-r0 \
libunistring=1.1-r1
#Get latest tag and clone the repo
ARG TAGcsmith_centauri=v0.4.1
RUN git clone --depth=1 -b $TAGcsmith_centauri --single-branch https://github.com/csmith/centauri /src/csmith/centauri

WORKDIR /src/csmith/centauri
RUN go build -tags netgo,osusergo -a -trimpath -ldflags='-w -extldflags "-static" -buildid= ' -tags lego_httpreq -o /rootfs/centauri ./cmd/centauri
WORKDIR /src/TAGcsmith_centauri
RUN go build -tags lego_httpreq,netgo,osusergo -a -trimpath -ldflags='-w -buildid=' -o /rootfs/centauri ./cmd/dex
RUN go-licenses save ./... --save_path=/notices --force
RUN cp -r /notices /rootfs/

FROM reg.g5d.dev/base@sha256:2efe0a4732e281176d0871d4e9db4d143156289192887a056d3eddd91d02d096

COPY --from=build --chown=65532:65532 /rootfs/ /
ENTRYPOINT ["/centauri"]

16 changes: 6 additions & 10 deletions centauri/Containerfile.gotpl
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{{ set "repo" "csmith/centauri" -}}
{{- set "cmd" "cmd/centauri" -}}
{{- set "tags" (list "lego_httpreq") -}}
{{- set "binary" "centauri" -}}
{{- set "volumes" (list "/home/nonroot/.config" "/data") -}}

{{- $repo := "csmith/centauri" -}}
{{- $binary := "centauri" -}}
FROM {{image "golang"}} AS build
{{ partial "create-directories.gotpl" }}
{{ partial "checkout-tag.gotpl" }}
{{ partial "static-go-build.gotpl" }}
{{ partial "from-base-add-binary.gotpl" }}
{{ create_volumes "/home/nonroot/.config" "/data" }}
{{ checkout_tag $repo }}
{{ go_build $repo $binary "cmd/dex" (list "lego_httpreq") (list) (list) }}
{{ from_base_add_binary $binary (list) (list) }}
135 changes: 62 additions & 73 deletions dex/Containerfile
Original file line number Diff line number Diff line change
@@ -1,85 +1,74 @@
# Generated from https://github.com/greboid/dockerfiles/blob/master/dex/Containerfile.gotpl
# BOM: {"apk:binutils":"2.40-r7","apk:brotli-libs":"1.0.9-r14","apk:busybox":"1.36.1-r2","apk:busybox-binsh":"1.36.1-r2","apk:ca-certificates":"20230506-r0","apk:gcc":"12.2.1_git20220924-r10","apk:git":"2.40.1-r0","apk:gmp":"6.2.1-r3","apk:isl25":"0.25-r2","apk:libacl":"2.3.1-r3","apk:libatomic":"12.2.1_git20220924-r10","apk:libcrypto3":"3.1.2-r0","apk:libcurl":"8.2.1-r0","apk:libexpat":"2.5.0-r1","apk:libgcc":"12.2.1_git20220924-r10","apk:libgomp":"12.2.1_git20220924-r10","apk:libidn2":"2.3.4-r1","apk:libncursesw":"6.4_p20230506-r0","apk:libssl3":"3.1.2-r0","apk:libstdc++":"12.2.1_git20220924-r10","apk:libunistring":"1.1-r1","apk:libxxhash":"0.8.2-r0","apk:lz4-libs":"1.9.4-r4","apk:mpc1":"1.3.1-r1","apk:mpfr4":"4.2.0_p12-r0","apk:musl":"1.2.4-r1","apk:ncurses-terminfo-base":"6.4_p20230506-r0","apk:nghttp2-libs":"1.55.1-r0","apk:pcre2":"10.42-r1","apk:popt":"1.19-r2","apk:readline":"8.2.1-r1","apk:rsync":"3.2.7-r4","apk:sqlite":"3.41.2-r2","apk:zlib":"1.2.13-r1","apk:zstd-libs":"1.5.5-r4","github:dexidp/dex":"v2.37.0","image:base":"2efe0a4732e281176d0871d4e9db4d143156289192887a056d3eddd91d02d096","image:golang":"ada25feadcd2358de8ef4f8fba32c5cd074439dea37ec7b34495738bb9882640"}
# BOM: {"apk:binutils":"2.40-r7","apk:brotli-libs":"1.0.9-r14","apk:busybox":"1.36.1-r2","apk:busybox-binsh":"1.36.1-r2","apk:ca-certificates":"20230506-r0","apk:gcc":"12.2.1_git20220924-r10","apk:git":"2.40.1-r0","apk:gmp":"6.2.1-r3","apk:isl25":"0.25-r2","apk:libacl":"2.3.1-r3","apk:libatomic":"12.2.1_git20220924-r10","apk:libcrypto3":"3.1.2-r0","apk:libcurl":"8.2.1-r0","apk:libexpat":"2.5.0-r1","apk:libgcc":"12.2.1_git20220924-r10","apk:libgomp":"12.2.1_git20220924-r10","apk:libidn2":"2.3.4-r1","apk:libncursesw":"6.4_p20230506-r0","apk:libssl3":"3.1.2-r0","apk:libstdc++":"12.2.1_git20220924-r10","apk:libunistring":"1.1-r1","apk:libxxhash":"0.8.2-r0","apk:lz4-libs":"1.9.4-r4","apk:mpc1":"1.3.1-r1","apk:mpfr4":"4.2.0_p12-r0","apk:musl":"1.2.4-r1","apk:ncurses-terminfo-base":"6.4_p20230506-r0","apk:nghttp2-libs":"1.55.1-r0","apk:pcre2":"10.42-r1","apk:popt":"1.19-r2","apk:readline":"8.2.1-r1","apk:rsync":"3.2.7-r4","apk:sqlite":"3.41.2-r2","apk:zlib":"1.2.13-r1","apk:zstd-libs":"1.5.5-r4","github:dexidp/dex":"v2.37.0","image:base":"2efe0a4732e281176d0871d4e9db4d143156289192887a056d3eddd91d02d096","image:golang":"1e89b999fbe8fac8ddac0ca839f89778d6b72bebcc4f6f03676f445c65cccf7e"}

FROM reg.g5d.dev/golang@sha256:ada25feadcd2358de8ef4f8fba32c5cd074439dea37ec7b34495738bb9882640 AS build
FROM reg.g5d.dev/golang@sha256:1e89b999fbe8fac8ddac0ca839f89778d6b72bebcc4f6f03676f445c65cccf7e AS build
#Install build dependencies
RUN apk add --no-cache \
musl=1.2.4-r1 \
libgomp=12.2.1_git20220924-r10 \
isl25=0.25-r2 \
libncursesw=6.4_p20230506-r0 \
sqlite=3.41.2-r2 \
gcc=12.2.1_git20220924-r10 \
readline=8.2.1-r1 \
libgcc=12.2.1_git20220924-r10 \
zstd-libs=1.5.5-r4 \
libatomic=12.2.1_git20220924-r10 \
gmp=6.2.1-r3 \
mpc1=1.3.1-r1 \
zlib=1.2.13-r1 \
ncurses-terminfo-base=6.4_p20230506-r0 \
binutils=2.40-r7 \
mpfr4=4.2.0_p12-r0 \
libstdc++=12.2.1_git20220924-r10

#Create required volumes
RUN mkdir -p \
/rootfs/db

#Ensure git is installed
RUN set -eux; \
#Install build dependencies
apk add --no-cache \binutils=2.40-r7 \
gcc=12.2.1_git20220924-r10 \
gmp=6.2.1-r3 \
isl25=0.25-r2 \
libatomic=12.2.1_git20220924-r10 \
libgcc=12.2.1_git20220924-r10 \
libgomp=12.2.1_git20220924-r10 \
libncursesw=6.4_p20230506-r0 \
libstdc++=12.2.1_git20220924-r10 \
mpc1=1.3.1-r1 \
mpfr4=4.2.0_p12-r0 \
musl=1.2.4-r1 \
ncurses-terminfo-base=6.4_p20230506-r0 \
readline=8.2.1-r1 \
sqlite=3.41.2-r2 \
zlib=1.2.13-r1 \
zstd-libs=1.5.5-r4
apk add --no-cache \
ca-certificates=20230506-r0 \
libunistring=1.1-r1 \
musl=1.2.4-r1 \
libexpat=2.5.0-r1 \
busybox-binsh=1.36.1-r2 \
libcurl=8.2.1-r0 \
pcre2=10.42-r1 \
brotli-libs=1.0.9-r14 \
libssl3=3.1.2-r0 \
nghttp2-libs=1.55.1-r0 \
busybox=1.36.1-r2 \
git=2.40.1-r0 \
zlib=1.2.13-r1 \
libcrypto3=3.1.2-r0 \
libidn2=2.3.4-r1
#Get latest tag and clone the repo
ARG TAGdexidp_dex=v2.37.0
RUN git clone --depth=1 -b $TAGdexidp_dex --single-branch https://github.com/dexidp/dex /src/dexidp/dex




RUN set -eux; \
#Create required directories
mkdir -p \
/rootfs/db

ARG TAGdex="v2.37.0"
RUN set -eux; \
#Ensure git is in the build environment
apk add --no-cache \
brotli-libs=1.0.9-r14 \
busybox=1.36.1-r2 \
busybox-binsh=1.36.1-r2 \
ca-certificates=20230506-r0 \
git=2.40.1-r0 \
libcrypto3=3.1.2-r0 \
libcurl=8.2.1-r0 \
libexpat=2.5.0-r1 \
libidn2=2.3.4-r1 \
libssl3=3.1.2-r0 \
libunistring=1.1-r1 \
musl=1.2.4-r1 \
nghttp2-libs=1.55.1-r0 \
pcre2=10.42-r1 \
zlib=1.2.13-r1

RUN git clone --depth=1 -b $TAGdex --single-branch https://github.com/dexidp/dex /src/dexidp/dex

WORKDIR /src/dexidp/dex
RUN go build -tags netgo,osusergo -a -trimpath -ldflags='-w -extldflags "-static" -buildid= ' -o /rootfs/dex ./cmd/dex
RUN go-licenses save ./... --save_path=/notices --force --ignore github.com/dexidp/dex/api/v2;
WORKDIR /src/TAGdexidp_dex
RUN go build -tags netgo,osusergo -a -trimpath -ldflags='-w -buildid=' -o /rootfs/dockercleanup ./cmd/dex
RUN go-licenses save ./... --save_path=/notices --force --ignore github.com/dexidp/dex/api/v2
RUN cp -r /notices /rootfs/

#Ensure rsync is installed
RUN apk add --no-cache \
lz4-libs=1.9.4-r4 \
popt=1.19-r2 \
libxxhash=0.8.2-r0 \
zlib=1.2.13-r1 \
zstd-libs=1.5.5-r4 \
rsync=3.2.7-r4 \
libacl=2.3.1-r3 \
musl=1.2.4-r1
#Copy directories into rootfs
RUN rsync -ap /src/TAGdexidp_dex/web/ /rootfs/


#Ensure rsync is available
RUN set -eux; \
apk add --no-cache \
libacl=2.3.1-r3 \
libxxhash=0.8.2-r0 \
lz4-libs=1.9.4-r4 \
musl=1.2.4-r1 \
popt=1.19-r2 \
rsync=3.2.7-r4 \
zlib=1.2.13-r1 \
zstd-libs=1.5.5-r4;

WORKDIR /src/dexidp/dex
RUN set -eux; \
#Copy required directories
rsync -ap /src/dexidp/dex/web/ /rootfs/web

FROM reg.g5d.dev/base@sha256:2efe0a4732e281176d0871d4e9db4d143156289192887a056d3eddd91d02d096

COPY --from=build --chown=65532:65532 /rootfs/ /
ENTRYPOINT ["/dex"]
ENTRYPOINT ["/dockercleanup"]
CMD ["serve", "/config.yml"]

24 changes: 8 additions & 16 deletions dex/Containerfile.gotpl
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
{{ set "repo" "dexidp/dex" -}}
{{- set "cmd" "cmd/dex" -}}
{{- set "binary" "dex" -}}
{{- set "runargs" (list "serve" "/config.yml") -}}
{{- set "buildDeps" (alpine_packages "sqlite" "gcc") -}}
{{- set "volumes" (list "/db") -}}
{{- set "directories" (list "/web") -}}
{{- set "skipnotices" (list "github.com/dexidp/dex/api/v2") -}}

{{- $repo := "dexidp/dex" -}}
{{- $binary := "dockercleanup" -}}
FROM {{image "golang"}} AS build
{{ partial "install-build-deps.gotpl" }}
{{ partial "install-run-deps.gotpl" }}
{{ partial "create-directories.gotpl" }}
{{ partial "checkout-tag.gotpl" }}
{{ partial "static-go-build.gotpl" }}
{{ partial "copy-directories.gotpl" }}
{{ partial "from-base-add-binary.gotpl" }}
{{ install_build_deps "sqlite" "gcc" }}
{{ create_volumes "/db" }}
{{ checkout_tag $repo }}
{{ go_build $repo $binary "cmd/dex" (list) (list) (list "github.com/dexidp/dex/api/v2") }}
{{ copy_directories $repo "/web" }}
{{ from_base_add_binary $binary (list) (list "serve" "/config.yml") }}
49 changes: 24 additions & 25 deletions dockercleanup/Containerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
# Generated from https://github.com/greboid/dockerfiles/blob/master/dockercleanup/Containerfile.gotpl
# BOM: {"apk:brotli-libs":"1.0.9-r14","apk:busybox":"1.36.1-r2","apk:busybox-binsh":"1.36.1-r2","apk:ca-certificates":"20230506-r0","apk:git":"2.40.1-r0","apk:libcrypto3":"3.1.2-r0","apk:libcurl":"8.2.1-r0","apk:libexpat":"2.5.0-r1","apk:libidn2":"2.3.4-r1","apk:libssl3":"3.1.2-r0","apk:libunistring":"1.1-r1","apk:musl":"1.2.4-r1","apk:nghttp2-libs":"1.55.1-r0","apk:pcre2":"10.42-r1","apk:zlib":"1.2.13-r1","github:greboid/dockercleanup":"v1.0.1","image:base":"2efe0a4732e281176d0871d4e9db4d143156289192887a056d3eddd91d02d096","image:golang":"ada25feadcd2358de8ef4f8fba32c5cd074439dea37ec7b34495738bb9882640"}
# BOM: {"apk:brotli-libs":"1.0.9-r14","apk:busybox":"1.36.1-r2","apk:busybox-binsh":"1.36.1-r2","apk:ca-certificates":"20230506-r0","apk:git":"2.40.1-r0","apk:libcrypto3":"3.1.2-r0","apk:libcurl":"8.2.1-r0","apk:libexpat":"2.5.0-r1","apk:libidn2":"2.3.4-r1","apk:libssl3":"3.1.2-r0","apk:libunistring":"1.1-r1","apk:musl":"1.2.4-r1","apk:nghttp2-libs":"1.55.1-r0","apk:pcre2":"10.42-r1","apk:zlib":"1.2.13-r1","github:greboid/dockercleanup":"v1.0.1","image:base":"2efe0a4732e281176d0871d4e9db4d143156289192887a056d3eddd91d02d096","image:golang":"1e89b999fbe8fac8ddac0ca839f89778d6b72bebcc4f6f03676f445c65cccf7e"}

FROM reg.g5d.dev/golang@sha256:ada25feadcd2358de8ef4f8fba32c5cd074439dea37ec7b34495738bb9882640 AS build
ARG TAGdockercleanup="v1.0.1"
FROM reg.g5d.dev/golang@sha256:1e89b999fbe8fac8ddac0ca839f89778d6b72bebcc4f6f03676f445c65cccf7e AS build
#Ensure git is installed
RUN set -eux; \
#Ensure git is in the build environment
apk add --no-cache \
brotli-libs=1.0.9-r14 \
busybox=1.36.1-r2 \
busybox-binsh=1.36.1-r2 \
ca-certificates=20230506-r0 \
git=2.40.1-r0 \
libcrypto3=3.1.2-r0 \
libcurl=8.2.1-r0 \
libexpat=2.5.0-r1 \
libidn2=2.3.4-r1 \
libssl3=3.1.2-r0 \
libunistring=1.1-r1 \
musl=1.2.4-r1 \
nghttp2-libs=1.55.1-r0 \
pcre2=10.42-r1 \
zlib=1.2.13-r1
RUN git clone --depth=1 -b $TAGdockercleanup --single-branch https://github.com/greboid/dockercleanup /src/greboid/dockercleanup
apk add --no-cache \
libexpat=2.5.0-r1 \
busybox=1.36.1-r2 \
git=2.40.1-r0 \
pcre2=10.42-r1 \
zlib=1.2.13-r1 \
ca-certificates=20230506-r0 \
brotli-libs=1.0.9-r14 \
libidn2=2.3.4-r1 \
libssl3=3.1.2-r0 \
musl=1.2.4-r1 \
libcurl=8.2.1-r0 \
libcrypto3=3.1.2-r0 \
nghttp2-libs=1.55.1-r0 \
busybox-binsh=1.36.1-r2 \
libunistring=1.1-r1
#Get latest tag and clone the repo
ARG TAGgreboid_dockercleanup=v1.0.1
RUN git clone --depth=1 -b $TAGgreboid_dockercleanup --single-branch https://github.com/greboid/dockercleanup /src/greboid/dockercleanup

WORKDIR /src/greboid/dockercleanup
RUN go build -tags netgo,osusergo -a -trimpath -ldflags='-w -extldflags "-static" -buildid= ' -o /rootfs/dockercleanup ./
WORKDIR /src/TAGgreboid_dockercleanup
RUN go build -tags netgo,osusergo -a -trimpath -ldflags='-w -buildid=' -o /rootfs/dockercleanup ./
RUN go-licenses save ./... --save_path=/notices --force
RUN cp -r /notices /rootfs/

FROM reg.g5d.dev/base@sha256:2efe0a4732e281176d0871d4e9db4d143156289192887a056d3eddd91d02d096

COPY --from=build --chown=65532:65532 /rootfs/ /
ENTRYPOINT ["/dockercleanup"]

12 changes: 5 additions & 7 deletions dockercleanup/Containerfile.gotpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{{ set "repo" "greboid/dockercleanup" -}}
{{- set "cmd" "" -}}
{{- set "binary" "dockercleanup" -}}

{{- $repo := "greboid/dockercleanup" -}}
{{- $binary := "dockercleanup" -}}
FROM {{image "golang"}} AS build
{{ partial "checkout-tag.gotpl" }}
{{ partial "static-go-build.gotpl" }}
{{ partial "from-base-add-binary.gotpl" }}
{{ checkout_tag $repo }}
{{ go_build $repo $binary "" (list) (list) (list) }}
{{ from_base_add_binary $binary (list) (list) }}
Loading

0 comments on commit 3d19b18

Please sign in to comment.