From 2f83b43b235ed37b6f6af0aeed0ab5ab21b780a9 Mon Sep 17 00:00:00 2001 From: Adrien le Maire Date: Sat, 8 May 2021 11:01:13 +0000 Subject: [PATCH] Update hugo/Dockerfile, hugo/hugo.sh, hugo/Makefile, .gitlab-ci.yml files Deleted borg/Dockerfile, borg/Makefile, borg/version, dendrite/Dockerfile, dendrite/Makefile, dendrite/entrypoint.sh, dendrite/version, minio/Dockerfile, minio/Makefile, minio/version, restic/Dockerfile, restic/Makefile, restic/version, watchdog/Dockerfile, watchdog/Makefile, watchdog/version files --- .gitlab-ci.yml | 6 +++--- borg/Dockerfile | 19 ---------------- borg/Makefile | 18 ---------------- borg/version | 1 - dendrite/Dockerfile | 15 ------------- dendrite/Makefile | 21 ------------------ dendrite/entrypoint.sh | 13 ----------- dendrite/version | 1 - hugo/Dockerfile | 12 +++++++++++ hugo/Makefile | 14 ++++++++++++ hugo/hugo.sh | 49 ++++++++++++++++++++++++++++++++++++++++++ minio/Dockerfile | 40 ---------------------------------- minio/Makefile | 19 ---------------- minio/version | 1 - restic/Dockerfile | 7 ------ restic/Makefile | 18 ---------------- restic/version | 1 - watchdog/Dockerfile | 8 ------- watchdog/Makefile | 19 ---------------- watchdog/version | 1 - 20 files changed, 78 insertions(+), 205 deletions(-) delete mode 100644 borg/Dockerfile delete mode 100644 borg/Makefile delete mode 100644 borg/version delete mode 100644 dendrite/Dockerfile delete mode 100644 dendrite/Makefile delete mode 100755 dendrite/entrypoint.sh delete mode 100644 dendrite/version create mode 100644 hugo/Dockerfile create mode 100644 hugo/Makefile create mode 100644 hugo/hugo.sh delete mode 100644 minio/Dockerfile delete mode 100644 minio/Makefile delete mode 100644 minio/version delete mode 100644 restic/Dockerfile delete mode 100644 restic/Makefile delete mode 100644 restic/version delete mode 100644 watchdog/Dockerfile delete mode 100644 watchdog/Makefile delete mode 100644 watchdog/version diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b0b3493..b89743f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,18 +20,18 @@ element: changes: - element/* -minio: +hugo: stage: build tags: - docker script: - - cd minio + - cd hugo - make push only: variables: - $CI_COMMIT_REF_PROTECTED == "true" changes: - - minio/* + - hugo/* dev-watchdog: stage: build diff --git a/borg/Dockerfile b/borg/Dockerfile deleted file mode 100644 index 924182a..0000000 --- a/borg/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM debian:buster-20210208-slim as builder -ARG DEBIAN_FRONTEND=noninteractive -ARG TARGETARCH -RUN apt update -qq && apt install wget -qqy && rm -rf /var/lib/apt/lists/* -ARG VERSION -RUN case $TARGETARCH in \ - arm) \ - wget https://dl.bintray.com/borg-binary-builder/borg-binaries/borg-${VERSION}-armv6 -O /usr/bin/borg \ - ;; \ - arm64) \ - wget https://dl.bintray.com/borg-binary-builder/borg-binaries/borg-${VERSION}-arm64 -O /usr/bin/borg \ - ;; \ - amd64) \ - wget https://github.com/borgbackup/borg/releases/download/${VERSION}/borg-linux64 -O /usr/bin/borg \ - ;; \ - esac && \ - chmod a+x /usr/bin/borg -FROM debian:buster-20210208-slim -COPY --from=builder /usr/bin/borg /usr/bin/borg diff --git a/borg/Makefile b/borg/Makefile deleted file mode 100644 index 275c4a6..0000000 --- a/borg/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -NAMESPACE=alemairebe -include version - -IMAGE=borg - -nopush: - docker buildx build --platform linux/amd64 --load \ - --build-arg VERSION=$(VERSION) \ - --tag ${NAMESPACE}/${IMAGE}:$(VERSION) \ - --tag ${CI_REGISTRY_IMAGE}/${IMAGE}:$(VERSION) . - -push: - docker buildx build --platform linux/amd64,linux/arm64,linux/arm --push \ - --build-arg VERSION=$(VERSION) \ - --cache-from=type=registry,ref=${NAMESPACE}/buildx:${IMAGE} \ - --cache-to=type=registry,ref=${NAMESPACE}/buildx:${IMAGE} \ - --tag ${NAMESPACE}/${IMAGE}:$(VERSION) \ - --tag ${CI_REGISTRY_IMAGE}/${IMAGE}:$(VERSION) . \ No newline at end of file diff --git a/borg/version b/borg/version deleted file mode 100644 index 18676ba..0000000 --- a/borg/version +++ /dev/null @@ -1 +0,0 @@ -VERSION=1.1.15 diff --git a/dendrite/Dockerfile b/dendrite/Dockerfile deleted file mode 100644 index 6f57592..0000000 --- a/dendrite/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM golang:buster as builder - -ARG DEBIAN_FRONTEND=noninteractive -ARG VERSION -WORKDIR / -RUN git clone -b v${VERSION} --depth 1 https://github.com/matrix-org/dendrite.git && \ - cd dendrite && rm -rf .git && ./build.sh - -FROM debian:buster-20210208-slim - -COPY --from=builder /dendrite/bin/ /usr/local/bin/ -COPY --from=builder /dendrite/dendrite-config.yaml /usr/local/share/ -COPY entrypoint.sh /usr/local/bin/ - -ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] diff --git a/dendrite/Makefile b/dendrite/Makefile deleted file mode 100644 index b216b1f..0000000 --- a/dendrite/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -NAMESPACE=alemairebe -include version - -IMAGE=dendrite - -nopush: - docker buildx build --platform linux/amd64 --load \ - --build-arg VERSION=$(VERSION) \ - --tag ${NAMESPACE}/${IMAGE}:$(VERSION) \ - --tag ${CI_REGISTRY_IMAGE}/${IMAGE}:$(VERSION) . - -push: - docker buildx build --platform linux/amd64,linux/arm64 --push \ - --build-arg VERSION=$(VERSION) \ - --cache-from=type=registry,ref=${NAMESPACE}/buildx:${IMAGE} \ - --cache-to=type=registry,ref=${NAMESPACE}/buildx:${IMAGE} \ - --tag ${NAMESPACE}/${IMAGE}:$(VERSION) \ - --tag ${CI_REGISTRY_IMAGE}/${IMAGE}:$(VERSION) . - -git-clone: - git clone -b v${VERSION} --depth 1 https://github.com/matrix-org/dendrite.git diff --git a/dendrite/entrypoint.sh b/dendrite/entrypoint.sh deleted file mode 100755 index 527e302..0000000 --- a/dendrite/entrypoint.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -if [ ! -f /usr/local/etc/dendrite.yaml ]; then - cp /usr/local/share/dendrite-config.yaml /usr/local/etc/dendrite.yaml -fi - -if [ ! -f /usr/local/etc/matrix_key.pem ]; then - /usr/local/bin/generate-keys --private-key /usr/local/etc/matrix_key.pem -fi - -/usr/local/bin/dendrite-monolith-server --config /usr/local/etc/dendrite.yaml - - diff --git a/dendrite/version b/dendrite/version deleted file mode 100644 index 7ecbd87..0000000 --- a/dendrite/version +++ /dev/null @@ -1 +0,0 @@ -VERSION=0.3.8 diff --git a/hugo/Dockerfile b/hugo/Dockerfile new file mode 100644 index 0000000..d462b17 --- /dev/null +++ b/hugo/Dockerfile @@ -0,0 +1,12 @@ +ARG DEBIAN_VERSION=20210408 +ARG HUGO_VERSION + +FROM docker.io/debian:bullseye-${DEBIAN_VERSION}-slim as builder +RUN apt-get update && apt-get install -y --no-install-recommends \ + rsync \ + openssh-client \ + wget \ + ca-certificates \ + && rm -rf /var/lib/apt/lists/* +COPY hugo.sh /root/hugo.sh +RUN chmod +x /root/hugo.sh && /root/hugo.sh diff --git a/hugo/Makefile b/hugo/Makefile new file mode 100644 index 0000000..d0bc49c --- /dev/null +++ b/hugo/Makefile @@ -0,0 +1,14 @@ +NAMESPACE=alemairebe +IMAGE=hugo +VERSION=0.83.1 + +push: build + + +build: + docker buildx build --platform linux/amd64,linux/arm64,linux/arm --push \ + --build-arg HUGO_VERSION=${VERSION} + --cache-from=type=registry,ref=${NAMESPACE}/buildx:${IMAGE} \ + --cache-to=type=registry,ref=${NAMESPACE}/buildx:${IMAGE} \ + --tag ${NAMESPACE}/${IMAGE}:$(VERSION) \ + --tag ${CI_REGISTRY_IMAGE}/${IMAGE}:$(VERSION) . diff --git a/hugo/hugo.sh b/hugo/hugo.sh new file mode 100644 index 0000000..2414e65 --- /dev/null +++ b/hugo/hugo.sh @@ -0,0 +1,49 @@ +#!/bin/sh + +# This file is triggered inside the _base/Dockerfile-base file. + +set -e +set -u + +# Variables +# HUGO_VERSION is edited in Dockerfile. + +# Architecture +TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64} + +if [ "$TARGETPLATFORM" = "linux/amd64" ]; then + HUGO_ARCH="64bit" +elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then + HUGO_ARCH="ARM64" +elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then + HUGO_ARCH="ARM" +else + echo "Unknown build architecture: $TARGETPLATFORM" + exit 2 +fi + +# Download binaries from release +wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-${HUGO_ARCH}.tar.gz +wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_checksums.txt + +# Verify checksums +grep hugo_${HUGO_VERSION}_Linux-${HUGO_ARCH}.tar.gz hugo_${HUGO_VERSION}_checksums.txt | sha256sum -c + +# Prepare folders +mkdir -p /usr/local/bin/ + +# Unpack downloaded content +tar -zxf hugo_${HUGO_VERSION}_Linux-${HUGO_ARCH}.tar.gz -C /usr/local/bin + +# Verify executable +/usr/local/bin/hugo version + +# Create autocompletion script +mkdir -p /etc/bash_completion.d +/usr/local/bin/hugo gen autocomplete > /etc/bash_completion.d/hugo.sh + +# Create version file +echo -n "${HUGO_VERSION}" > /etc/hugo-release + +# Remove binaries +rm hugo_${HUGO_VERSION}_Linux-${HUGO_ARCH}.tar.gz hugo_${HUGO_VERSION}_checksums.txt diff --git a/minio/Dockerfile b/minio/Dockerfile deleted file mode 100644 index 79d4390..0000000 --- a/minio/Dockerfile +++ /dev/null @@ -1,40 +0,0 @@ -FROM golang:1.15-alpine as builder - -LABEL maintainer="MinIO Inc " -ARG VERSION -ARG TARGETARCH -ENV VERSION $VERSION -ENV GOPATH /go -ENV CGO_ENABLED 0 -ENV GO111MODULE on - -RUN \ - apk add --no-cache git && \ - git clone -b ${VERSION} --depth 1 https://github.com/minio/minio && cd minio && \ - go install -v -ldflags "$(go run buildscripts/gen-ldflags.go)" - - -FROM alpine:3.13.0 - -ENV MINIO_ACCESS_KEY_FILE=access_key \ - MINIO_SECRET_KEY_FILE=secret_key \ - MINIO_KMS_MASTER_KEY_FILE=kms_master_key \ - MINIO_SSE_MASTER_KEY_FILE=sse_master_key \ - MINIO_UPDATE_MINISIGN_PUBKEY="RWTx5Zr1tiHQLwG9keckT0c45M3AGeHD6IvimQHpyRywVWGbP1aVSGav" - -EXPOSE 9000 - -RUN \ - apk add --no-cache ca-certificates 'curl>7.61.0' 'su-exec>=0.2' && \ - echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf - -ARG VERSION -ENV VERSION $VERSION -COPY --from=builder /go/bin/minio /usr/bin/minio -COPY --from=builder /go/minio/dockerscripts/docker-entrypoint.sh /usr/bin/ - -ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"] - -VOLUME ["/data"] - -CMD ["minio"] diff --git a/minio/Makefile b/minio/Makefile deleted file mode 100644 index 702e8a4..0000000 --- a/minio/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -NAMESPACE=alemairebe -include version - -IMAGE=minio - -nopush: - docker buildx build --platform linux/amd64 --load \ - --build-arg VERSION=$(VERSION) \ - --tag ${NAMESPACE}/${IMAGE}:$(VERSION) \ - --tag ${CI_REGISTRY_IMAGE}/${IMAGE}:$(VERSION) . - -push: - docker buildx build --platform linux/amd64,linux/arm64,linux/arm --push \ - --build-arg VERSION=$(VERSION) \ - --cache-from=type=registry,ref=${NAMESPACE}/buildx:${IMAGE} \ - --cache-to=type=registry,ref=${NAMESPACE}/buildx:${IMAGE} \ - --tag ${NAMESPACE}/${IMAGE}:$(VERSION) \ - --tag ${CI_REGISTRY_IMAGE}/${IMAGE}:$(VERSION) . - diff --git a/minio/version b/minio/version deleted file mode 100644 index b5b438e..0000000 --- a/minio/version +++ /dev/null @@ -1 +0,0 @@ -VERSION=RELEASE.2021-02-07T01-31-02Z diff --git a/restic/Dockerfile b/restic/Dockerfile deleted file mode 100644 index 3db116d..0000000 --- a/restic/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM alpine:3.13.0 -ARG VERSION -ARG TARGETARCH -ENV VERSION $VERSION -ADD https://github.com/restic/restic/releases/download/v${VERSION}/restic_${VERSION}_linux_${TARGETARCH}.bz2 /root/restic.bz2 -RUN bunzip2 /root/restic.bz2 && chmod +x /root/restic && mv /root/restic /usr/bin/restic -ENTRYPOINT ["/usr/bin/restic"] diff --git a/restic/Makefile b/restic/Makefile deleted file mode 100644 index 09ae2b4..0000000 --- a/restic/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -NAMESPACE=alemairebe -include version - -IMAGE=restic - -nopush: - docker buildx build --platform linux/amd64 --load \ - --build-arg VERSION=$(VERSION) \ - --tag ${NAMESPACE}/${IMAGE}:$(VERSION) \ - --tag ${CI_REGISTRY_IMAGE}/${IMAGE}:$(VERSION) . - -push: - docker buildx build --platform linux/amd64,linux/arm64,linux/arm,linux/ppc64le --push \ - --build-arg VERSION=$(VERSION) \ - --cache-from=type=registry,ref=${NAMESPACE}/buildx:${IMAGE} \ - --cache-to=type=registry,ref=${NAMESPACE}/buildx:${IMAGE} \ - --tag ${NAMESPACE}/${IMAGE}:$(VERSION) \ - --tag ${CI_REGISTRY_IMAGE}/${IMAGE}:$(VERSION) . diff --git a/restic/version b/restic/version deleted file mode 100644 index df70d37..0000000 --- a/restic/version +++ /dev/null @@ -1 +0,0 @@ -VERSION=0.11.0 diff --git a/watchdog/Dockerfile b/watchdog/Dockerfile deleted file mode 100644 index 8821258..0000000 --- a/watchdog/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM debian:buster-20210408-slim -ARG DEBIAN_FRONTEND=noninteractive -ARG VERSION -RUN apt update -qq && \ - apt install -qqy --no-install-recommends watchdog=$VERSION && \ - rm -rf /var/lib/apt/lists/* - -ENTRYPOINT ["/usr/sbin/watchdog", "-F"] diff --git a/watchdog/Makefile b/watchdog/Makefile deleted file mode 100644 index 831538d..0000000 --- a/watchdog/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -NAMESPACE=alemairebe -include version - -IMAGE=watchdog - -nopush: - docker buildx build --platform linux/amd64 --load \ - --build-arg VERSION=$(VERSION) \ - --tag ${NAMESPACE}/${IMAGE}:$(VERSION) \ - --tag ${CI_REGISTRY_IMAGE}/${IMAGE}:$(VERSION) . - -push: - docker buildx build --platform linux/amd64,linux/arm64,linux/arm,linux/ppc64le --push \ - --build-arg VERSION=$(VERSION) \ - --cache-from=type=registry,ref=${NAMESPACE}/buildx:${IMAGE} \ - --cache-to=type=registry,ref=${NAMESPACE}/buildx:${IMAGE} \ - --tag ${NAMESPACE}/${IMAGE}:$(VERSION) \ - --tag ${CI_REGISTRY_IMAGE}/${IMAGE}:$(VERSION) . - diff --git a/watchdog/version b/watchdog/version deleted file mode 100644 index 66a9474..0000000 --- a/watchdog/version +++ /dev/null @@ -1 +0,0 @@ -VERSION=5.15-2