Skip to content

Commit

Permalink
Merge pull request #40 from theohbrothers/enhancement/remove-alpine-x…
Browse files Browse the repository at this point in the history
…-suffix-from-docker-tags

Enhancement: Remove `alpine-*` suffix from docker tags
  • Loading branch information
leojonathanoh authored Sep 20, 2023
2 parents c52aa0e + e5e8b9b commit d68f9a8
Show file tree
Hide file tree
Showing 23 changed files with 404 additions and 66 deletions.
106 changes: 53 additions & 53 deletions .github/workflows/ci-master-pr.yml

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ Dockerized [`webhook`](https://github.com/adnanh/webhook) with useful tools.

| Tag | Dockerfile Build Context |
|:-------:|:---------:|
| `:2.8.1-alpine-3.17`, `:latest` | [View](variants/2.8.1-alpine-3.17) |
| `:2.8.1-libvirt-8-alpine-3.17` | [View](variants/2.8.1-libvirt-8-alpine-3.17) |
| `:2.8.1-curl-git-jq-sops-ssh-alpine-3.17` | [View](variants/2.8.1-curl-git-jq-sops-ssh-alpine-3.17) |
| `:2.8.1-libvirt-7-alpine-3.15` | [View](variants/2.8.1-libvirt-7-alpine-3.15) |
| `:2.8.1-libvirt-6-alpine-3.13` | [View](variants/2.8.1-libvirt-6-alpine-3.13) |
| `:2.7.0-alpine-3.17` | [View](variants/2.7.0-alpine-3.17) |
| `:2.7.0-libvirt-8-alpine-3.17` | [View](variants/2.7.0-libvirt-8-alpine-3.17) |
| `:2.7.0-curl-git-jq-sops-ssh-alpine-3.17` | [View](variants/2.7.0-curl-git-jq-sops-ssh-alpine-3.17) |
| `:2.7.0-libvirt-7-alpine-3.15` | [View](variants/2.7.0-libvirt-7-alpine-3.15) |
| `:2.7.0-libvirt-6-alpine-3.13` | [View](variants/2.7.0-libvirt-6-alpine-3.13) |
| `:2.8.1`, `:latest` | [View](variants/2.8.1) |
| `:2.8.1-libvirt-8` | [View](variants/2.8.1-libvirt-8) |
| `:2.8.1-curl-git-jq-sops-ssh` | [View](variants/2.8.1-curl-git-jq-sops-ssh) |
| `:2.8.1-libvirt-7` | [View](variants/2.8.1-libvirt-7) |
| `:2.8.1-libvirt-6` | [View](variants/2.8.1-libvirt-6) |
| `:2.7.0` | [View](variants/2.7.0) |
| `:2.7.0-libvirt-8` | [View](variants/2.7.0-libvirt-8) |
| `:2.7.0-curl-git-jq-sops-ssh` | [View](variants/2.7.0-curl-git-jq-sops-ssh) |
| `:2.7.0-libvirt-7` | [View](variants/2.7.0-libvirt-7) |
| `:2.7.0-libvirt-6` | [View](variants/2.7.0-libvirt-6) |

## Usage

Expand Down
6 changes: 3 additions & 3 deletions generate/definitions/VARIANTS.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ $VARIANTS = @(
}
components = $subVariant['components']
}
# Docker image tag. E.g. '3.8-curl'
# Docker image tag. E.g. '2.8.1' or '2.8.1-libvirt-8'
tag = @(
$variant['package_version']
$subVariant['components'] | ? { $_ }
$variant['distro']
$variant['distro_version']
# $variant['distro']
# $variant['distro_version']
) -join '-'
tag_as_latest = if ($variant['package_version'] -eq $local:VARIANTS_MATRIX[0]['package_version'] -and $variant['distro_version'] -eq $local:VARIANTS_MATRIX[0]['distro_version'] -and $subVariant['components'].Count -eq 0) { $true } else { $false }
}
Expand Down
34 changes: 34 additions & 0 deletions variants/2.7.0-curl-git-jq-sops-ssh/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM golang:1.20-alpine as builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

RUN set -eux; \
apk add --no-cache git; \
git clone https://github.com/adnanh/webhook.git /src --branch 2.7.0; \
cd /src; \
go build -ldflags="-s -w" -o /usr/local/bin/webhook;

FROM alpine:3.17
COPY --from=builder /usr/local/bin/webhook /usr/local/bin/webhook
RUN webhook --version

RUN apk add --no-cache ca-certificates
RUN apk add --no-cache curl
RUN apk add --no-cache git
RUN apk add --no-cache jq
RUN set -eux; \
wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops; \
chmod +x /usr/local/bin/sops; \
sha256sum /usr/local/bin/sops | grep '^185348fd77fc160d5bdf3cd20ecbc796163504fd3df196d7cb29000773657b74 '; \
sops --version

RUN apk add --no-cache gnupg
RUN apk add --no-cache openssh-client
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

WORKDIR /config
ENTRYPOINT [ "/docker-entrypoint.sh" ]
EXPOSE 9000
CMD [ "-verbose", "-hooks=/config/hooks.yml", "-hotreload" ]
8 changes: 8 additions & 0 deletions variants/2.7.0-curl-git-jq-sops-ssh/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- webhook "$@"
fi

exec "$@"
24 changes: 24 additions & 0 deletions variants/2.7.0-libvirt-6/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM golang:1.20-alpine as builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

RUN set -eux; \
apk add --no-cache git; \
git clone https://github.com/adnanh/webhook.git /src --branch 2.7.0; \
cd /src; \
go build -ldflags="-s -w" -o /usr/local/bin/webhook;

FROM alpine:3.13
COPY --from=builder /usr/local/bin/webhook /usr/local/bin/webhook
RUN webhook --version

RUN apk add --no-cache ca-certificates
RUN apk add --no-cache libvirt-client
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

WORKDIR /config
ENTRYPOINT [ "/docker-entrypoint.sh" ]
EXPOSE 9000
CMD [ "-verbose", "-hooks=/config/hooks.yml", "-hotreload" ]
8 changes: 8 additions & 0 deletions variants/2.7.0-libvirt-6/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- webhook "$@"
fi

exec "$@"
24 changes: 24 additions & 0 deletions variants/2.7.0-libvirt-7/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM golang:1.20-alpine as builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

RUN set -eux; \
apk add --no-cache git; \
git clone https://github.com/adnanh/webhook.git /src --branch 2.7.0; \
cd /src; \
go build -ldflags="-s -w" -o /usr/local/bin/webhook;

FROM alpine:3.15
COPY --from=builder /usr/local/bin/webhook /usr/local/bin/webhook
RUN webhook --version

RUN apk add --no-cache ca-certificates
RUN apk add --no-cache libvirt-client
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

WORKDIR /config
ENTRYPOINT [ "/docker-entrypoint.sh" ]
EXPOSE 9000
CMD [ "-verbose", "-hooks=/config/hooks.yml", "-hotreload" ]
8 changes: 8 additions & 0 deletions variants/2.7.0-libvirt-7/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- webhook "$@"
fi

exec "$@"
24 changes: 24 additions & 0 deletions variants/2.7.0-libvirt-8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM golang:1.20-alpine as builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

RUN set -eux; \
apk add --no-cache git; \
git clone https://github.com/adnanh/webhook.git /src --branch 2.7.0; \
cd /src; \
go build -ldflags="-s -w" -o /usr/local/bin/webhook;

FROM alpine:3.17
COPY --from=builder /usr/local/bin/webhook /usr/local/bin/webhook
RUN webhook --version

RUN apk add --no-cache ca-certificates
RUN apk add --no-cache libvirt-client
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

WORKDIR /config
ENTRYPOINT [ "/docker-entrypoint.sh" ]
EXPOSE 9000
CMD [ "-verbose", "-hooks=/config/hooks.yml", "-hotreload" ]
8 changes: 8 additions & 0 deletions variants/2.7.0-libvirt-8/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- webhook "$@"
fi

exec "$@"
23 changes: 23 additions & 0 deletions variants/2.7.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM golang:1.20-alpine as builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

RUN set -eux; \
apk add --no-cache git; \
git clone https://github.com/adnanh/webhook.git /src --branch 2.7.0; \
cd /src; \
go build -ldflags="-s -w" -o /usr/local/bin/webhook;

FROM alpine:3.17
COPY --from=builder /usr/local/bin/webhook /usr/local/bin/webhook
RUN webhook --version

RUN apk add --no-cache ca-certificates
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

WORKDIR /config
ENTRYPOINT [ "/docker-entrypoint.sh" ]
EXPOSE 9000
CMD [ "-verbose", "-hooks=/config/hooks.yml", "-hotreload" ]
8 changes: 8 additions & 0 deletions variants/2.7.0/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- webhook "$@"
fi

exec "$@"
34 changes: 34 additions & 0 deletions variants/2.8.1-curl-git-jq-sops-ssh/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM golang:1.20-alpine as builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

RUN set -eux; \
apk add --no-cache git; \
git clone https://github.com/adnanh/webhook.git /src --branch 2.8.1; \
cd /src; \
go build -ldflags="-s -w" -o /usr/local/bin/webhook;

FROM alpine:3.17
COPY --from=builder /usr/local/bin/webhook /usr/local/bin/webhook
RUN webhook --version

RUN apk add --no-cache ca-certificates
RUN apk add --no-cache curl
RUN apk add --no-cache git
RUN apk add --no-cache jq
RUN set -eux; \
wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops; \
chmod +x /usr/local/bin/sops; \
sha256sum /usr/local/bin/sops | grep '^185348fd77fc160d5bdf3cd20ecbc796163504fd3df196d7cb29000773657b74 '; \
sops --version

RUN apk add --no-cache gnupg
RUN apk add --no-cache openssh-client
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

WORKDIR /config
ENTRYPOINT [ "/docker-entrypoint.sh" ]
EXPOSE 9000
CMD [ "-verbose", "-hooks=/config/hooks.yml", "-hotreload" ]
8 changes: 8 additions & 0 deletions variants/2.8.1-curl-git-jq-sops-ssh/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- webhook "$@"
fi

exec "$@"
24 changes: 24 additions & 0 deletions variants/2.8.1-libvirt-6/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM golang:1.20-alpine as builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

RUN set -eux; \
apk add --no-cache git; \
git clone https://github.com/adnanh/webhook.git /src --branch 2.8.1; \
cd /src; \
go build -ldflags="-s -w" -o /usr/local/bin/webhook;

FROM alpine:3.13
COPY --from=builder /usr/local/bin/webhook /usr/local/bin/webhook
RUN webhook --version

RUN apk add --no-cache ca-certificates
RUN apk add --no-cache libvirt-client
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

WORKDIR /config
ENTRYPOINT [ "/docker-entrypoint.sh" ]
EXPOSE 9000
CMD [ "-verbose", "-hooks=/config/hooks.yml", "-hotreload" ]
8 changes: 8 additions & 0 deletions variants/2.8.1-libvirt-6/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- webhook "$@"
fi

exec "$@"
24 changes: 24 additions & 0 deletions variants/2.8.1-libvirt-7/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM golang:1.20-alpine as builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

RUN set -eux; \
apk add --no-cache git; \
git clone https://github.com/adnanh/webhook.git /src --branch 2.8.1; \
cd /src; \
go build -ldflags="-s -w" -o /usr/local/bin/webhook;

FROM alpine:3.15
COPY --from=builder /usr/local/bin/webhook /usr/local/bin/webhook
RUN webhook --version

RUN apk add --no-cache ca-certificates
RUN apk add --no-cache libvirt-client
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

WORKDIR /config
ENTRYPOINT [ "/docker-entrypoint.sh" ]
EXPOSE 9000
CMD [ "-verbose", "-hooks=/config/hooks.yml", "-hotreload" ]
8 changes: 8 additions & 0 deletions variants/2.8.1-libvirt-7/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- webhook "$@"
fi

exec "$@"
24 changes: 24 additions & 0 deletions variants/2.8.1-libvirt-8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM golang:1.20-alpine as builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

RUN set -eux; \
apk add --no-cache git; \
git clone https://github.com/adnanh/webhook.git /src --branch 2.8.1; \
cd /src; \
go build -ldflags="-s -w" -o /usr/local/bin/webhook;

FROM alpine:3.17
COPY --from=builder /usr/local/bin/webhook /usr/local/bin/webhook
RUN webhook --version

RUN apk add --no-cache ca-certificates
RUN apk add --no-cache libvirt-client
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

WORKDIR /config
ENTRYPOINT [ "/docker-entrypoint.sh" ]
EXPOSE 9000
CMD [ "-verbose", "-hooks=/config/hooks.yml", "-hotreload" ]
8 changes: 8 additions & 0 deletions variants/2.8.1-libvirt-8/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- webhook "$@"
fi

exec "$@"
Loading

0 comments on commit d68f9a8

Please sign in to comment.