From c3ee7ce88643011800e78d880791020cda69cf7a Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 7 Mar 2022 03:44:51 -0500 Subject: [PATCH 01/10] fix: ensure buildx is available during the release process Without this, we cannot build the docker image during a release. --- .github/workflows/release.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 24a2ddab1..c224544cc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,6 +33,21 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + + - name: Inspect builder + run: | + echo "Name: ${{ steps.buildx.outputs.name }}" + echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}" + echo "Status: ${{ steps.buildx.outputs.status }}" + echo "Flags: ${{ steps.buildx.outputs.flags }}" + echo "Platforms: ${{ steps.buildx.outputs.platforms }}" + - name: install package_cloud run: gem install package_cloud From 669c23256213506ff6a4fc382186d19181ed4779 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 7 Mar 2022 03:45:32 -0500 Subject: [PATCH 02/10] feat: test building the docker image when building a non-release --- .github/workflows/ci.yml | 7 +++++++ .github/workflows/release.yml | 8 ++++---- contrib/release-dokku | 5 ++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2fee872b7..a7a3c8076 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,13 @@ jobs: steps: - uses: actions/checkout@v2 + - name: set up qemu + uses: docker/setup-qemu-action@v1 + + - name: set up docker buildx + id: buildx + uses: docker/setup-buildx-action@v1 + - name: build package run: ./tests/ci/setup.sh build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c224544cc..2d90c24da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,20 +27,20 @@ jobs: with: ruby-version: 2.6 - - name: Login to Docker Hub + - name: login to docker hub uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Set up QEMU + - name: set up qemu uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx + - name: set up docker buildx id: buildx uses: docker/setup-buildx-action@v1 - - name: Inspect builder + - name: inspect builder run: | echo "Name: ${{ steps.buildx.outputs.name }}" echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}" diff --git a/contrib/release-dokku b/contrib/release-dokku index 42bceb339..1ec03cac0 100755 --- a/contrib/release-dokku +++ b/contrib/release-dokku @@ -363,7 +363,8 @@ fn-build-docker-image() { docker buildx build \ --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \ --progress plain \ - --tag "dokku/dokku:$VERSION" . + --tag "dokku/dokku:latest" \ + --tag "dokku/dokku:$(echo "$VERSION" | tr + -)" . fi } @@ -422,6 +423,8 @@ main() { fn-build-docker-image "$NEXT_VERSION" "$IS_RELEASE" || log-fail "Error building docker image" fn-repo-push-tags "$IS_RELEASE" + else + fn-build-docker-image "$NEXT_VERSION" "$IS_RELEASE" || log-fail "Error building docker image" fi if [[ "$IS_RELEASE" != "true" ]]; then From af8327e76bfb0031521ba1d551e8bebeb2b3892c Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 7 Mar 2022 06:22:03 -0500 Subject: [PATCH 03/10] chore: update build/test dependency versions --- Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index a6e9b3972..8f7afb442 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,12 @@ DOKKU_VERSION ?= master -DOCKER_IMAGE_LABELER_VERSION ?= 0.2.2 -HEROKUISH_VERSION ?= 0.5.25 -NETRC_VERSION ?= 0.3.0 -PLUGN_VERSION ?= 0.6.1 -PROCFILE_VERSION ?= 0.11.0 -SIGIL_VERSION ?= 0.6.0 -SSHCOMMAND_VERSION ?= 0.12.0 +DOCKER_IMAGE_LABELER_VERSION ?= 0.4.1 +HEROKUISH_VERSION ?= 0.5.34 +NETRC_VERSION ?= 0.5.1 +PLUGN_VERSION ?= 0.8.2 +PROCFILE_VERSION ?= 0.14.1 +SIGIL_VERSION ?= 0.8.1 +SSHCOMMAND_VERSION ?= 0.15.0 DOCKER_IMAGE_LABELER_URL ?= https://github.com/dokku/docker-image-labeler/releases/download/v${DOCKER_IMAGE_LABELER_VERSION}/docker-image-labeler_${DOCKER_IMAGE_LABELER_VERSION}_linux_x86_64.tgz NETRC_URL ?= https://github.com/dokku/netrc/releases/download/v${NETRC_VERSION}/netrc_${NETRC_VERSION}_linux_x86_64.tgz PLUGN_URL ?= https://github.com/dokku/plugn/releases/download/v${PLUGN_VERSION}/plugn_${PLUGN_VERSION}_linux_x86_64.tgz From e0090d9bf68f5155bfb3aaa39d03dc390ee86bb2 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 7 Mar 2022 06:43:22 -0500 Subject: [PATCH 04/10] fix: use generic architecture version of sshcommand --- tests/ci/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ci/setup.sh b/tests/ci/setup.sh index 5a5760649..8ac196f3e 100755 --- a/tests/ci/setup.sh +++ b/tests/ci/setup.sh @@ -35,7 +35,7 @@ install_dependencies() { SSHCOMMAND_VERSION=$(grep SSHCOMMAND_VERSION "${ROOT_DIR}/Makefile" | head -n1 | cut -d' ' -f3) SSHCOMMAND_PACKAGE_NAME="sshcommand_${SSHCOMMAND_VERSION}_amd64.deb" if [[ ! -f "$ROOT_DIR/build/${SSHCOMMAND_PACKAGE_NAME}" ]]; then - curl -L "https://packagecloud.io/dokku/dokku/packages/ubuntu/bionic/sshcommand_${SSHCOMMAND_VERSION}_amd64.deb/download.deb" -o "$ROOT_DIR/build/${SSHCOMMAND_PACKAGE_NAME}" + curl -L "https://packagecloud.io/dokku/dokku/packages/ubuntu/bionic/sshcommand_${SSHCOMMAND_VERSION}_all.deb/download.deb" -o "$ROOT_DIR/build/${SSHCOMMAND_PACKAGE_NAME}" fi SIGIL_VERSION=$(grep SIGIL_VERSION "${ROOT_DIR}/Makefile" | head -n1 | cut -d' ' -f3) From 9e10fbf808800f8f5c5bb434ad2c0cd8198436b4 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 7 Mar 2022 06:57:55 -0500 Subject: [PATCH 05/10] fix: reference correct urls for amd64 tarballs --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 8f7afb442..80de4d417 100644 --- a/Makefile +++ b/Makefile @@ -7,11 +7,11 @@ PLUGN_VERSION ?= 0.8.2 PROCFILE_VERSION ?= 0.14.1 SIGIL_VERSION ?= 0.8.1 SSHCOMMAND_VERSION ?= 0.15.0 -DOCKER_IMAGE_LABELER_URL ?= https://github.com/dokku/docker-image-labeler/releases/download/v${DOCKER_IMAGE_LABELER_VERSION}/docker-image-labeler_${DOCKER_IMAGE_LABELER_VERSION}_linux_x86_64.tgz -NETRC_URL ?= https://github.com/dokku/netrc/releases/download/v${NETRC_VERSION}/netrc_${NETRC_VERSION}_linux_x86_64.tgz -PLUGN_URL ?= https://github.com/dokku/plugn/releases/download/v${PLUGN_VERSION}/plugn_${PLUGN_VERSION}_linux_x86_64.tgz -PROCFILE_UTIL_URL ?= https://github.com/josegonzalez/go-procfile-util/releases/download/v${PROCFILE_VERSION}/procfile-util_${PROCFILE_VERSION}_linux_x86_64.tgz -SIGIL_URL ?= https://github.com/gliderlabs/sigil/releases/download/v${SIGIL_VERSION}/sigil_${SIGIL_VERSION}_Linux_x86_64.tgz +DOCKER_IMAGE_LABELER_URL ?= https://github.com/dokku/docker-image-labeler/releases/download/v${DOCKER_IMAGE_LABELER_VERSION}/docker-image-labeler_${DOCKER_IMAGE_LABELER_VERSION}_linux_amd64.tgz +NETRC_URL ?= https://github.com/dokku/netrc/releases/download/v${NETRC_VERSION}/netrc_${NETRC_VERSION}_linux_amd64.tgz +PLUGN_URL ?= https://github.com/dokku/plugn/releases/download/v${PLUGN_VERSION}/plugn_${PLUGN_VERSION}_linux_amd64.tgz +PROCFILE_UTIL_URL ?= https://github.com/josegonzalez/go-procfile-util/releases/download/v${PROCFILE_VERSION}/procfile-util_${PROCFILE_VERSION}_linux_amd64.tgz +SIGIL_URL ?= https://github.com/gliderlabs/sigil/releases/download/v${SIGIL_VERSION}/gliderlabs-sigil_${SIGIL_VERSION}_linux_amd64.tgz SSHCOMMAND_URL ?= https://github.com/dokku/sshcommand/releases/download/v${SSHCOMMAND_VERSION}/sshcommand_${SSHCOMMAND_VERSION}_linux_x86_64.tgz STACK_URL ?= https://github.com/gliderlabs/herokuish.git PREBUILT_STACK_URL ?= gliderlabs/herokuish:latest-20 From d4eaa1dc154f0d8f5e00cff5f3c497394efd4043 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 7 Mar 2022 07:17:39 -0500 Subject: [PATCH 06/10] fix: move files into correct place when installing via make --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 80de4d417..2743de58a 100644 --- a/Makefile +++ b/Makefile @@ -155,22 +155,27 @@ man-db: docker-image-labeler: wget -qO /tmp/docker-image-labeler_latest.tgz ${DOCKER_IMAGE_LABELER_URL} tar xzf /tmp/docker-image-labeler_latest.tgz -C /usr/local/bin + mv /usr/local/bin/docker-image-labeler-amd64 /usr/local/bin/docker-image-labeler netrc: wget -qO /tmp/netrc_latest.tgz ${NETRC_URL} tar xzf /tmp/netrc_latest.tgz -C /usr/local/bin + mv /usr/local/bin/netrc-amd64 /usr/local/bin/netrc procfile-util: wget -qO /tmp/procfile-util_latest.tgz ${PROCFILE_UTIL_URL} tar xzf /tmp/procfile-util_latest.tgz -C /usr/local/bin + mv /usr/local/bin/procfile-util-amd64 /usr/local/bin/procfile-util plugn: wget -qO /tmp/plugn_latest.tgz ${PLUGN_URL} tar xzf /tmp/plugn_latest.tgz -C /usr/local/bin + mv /usr/local/bin/plugn-amd64 /usr/local/bin/plugn sigil: wget -qO /tmp/sigil_latest.tgz ${SIGIL_URL} tar xzf /tmp/sigil_latest.tgz -C /usr/local/bin + mv /usr/local/bin/gliderlabs-sigil-amd64 /usr/local/bin/sigil sshcommand: wget -qO /tmp/sshcommand_latest.tgz ${SSHCOMMAND_URL} From 19cdc00345c7156302357f53f0d50a2d8f6dbf95 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 7 Mar 2022 07:38:47 -0500 Subject: [PATCH 07/10] chore: remove quiet flags from apt calls for debugging --- Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9088cc1de..2c452031e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,12 +25,12 @@ RUN echo "dokku dokku/hostname string $DOKKU_HOSTNAME" | debconf-set-selections && echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ bionic main" | tee /etc/apt/sources.list.d/dokku.list \ && mkdir -p /etc/nginx/ \ && cp /tmp/dhparam.pem /etc/nginx/dhparam.pem \ - && apt-get update -qq \ - && apt-get upgrade -qq -y \ - && apt-get -qq -y --no-install-recommends --only-upgrade install openssl openssh-server \ - && apt-get -qq -y --no-install-recommends install rsync "/tmp/dokku-$(dpkg --print-architecture).deb" \ - && apt-get purge -qq -y syslog-ng-core \ - && apt-get autoremove -qq -y \ + && apt-get update \ + && apt-get upgrade -y \ + && apt-get -y --no-install-recommends --only-upgrade install openssl openssh-server \ + && apt-get -y --no-install-recommends install rsync "/tmp/dokku-$(dpkg --print-architecture).deb" \ + && apt-get purge -y syslog-ng-core \ + && apt-get autoremove -y \ && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* WORKDIR /tmp From 334e85273e331af7e2b326d9f69875265f69298c Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 8 Mar 2022 00:48:32 -0500 Subject: [PATCH 08/10] fix: use correct platforms for buildx --- contrib/release-dokku | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/release-dokku b/contrib/release-dokku index 1ec03cac0..c918c659d 100755 --- a/contrib/release-dokku +++ b/contrib/release-dokku @@ -354,14 +354,14 @@ fn-build-docker-image() { if [[ "$IS_RELEASE" == "true" ]]; then docker buildx build \ - --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \ + --platform linux/arm,linux/arm64,linux/amd64 \ --progress plain \ --push \ --tag "dokku/dokku:latest" \ --tag "dokku/dokku:$VERSION" . else docker buildx build \ - --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \ + --platform linux/arm,linux/arm64,linux/amd64 \ --progress plain \ --tag "dokku/dokku:latest" \ --tag "dokku/dokku:$(echo "$VERSION" | tr + -)" . From 198664ac586eff5b6ae621b37327fbcbe4cca2df Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 8 Mar 2022 01:31:47 -0500 Subject: [PATCH 09/10] fix: use correct epo --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2c452031e..5fe94a8ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,7 @@ RUN echo "dokku dokku/hostname string $DOKKU_HOSTNAME" | debconf-set-selections && echo "dokku dokku/skip_key_file boolean $DOKKU_SKIP_KEY_FILE" | debconf-set-selections \ && echo "dokku dokku/vhost_enable boolean $DOKKU_VHOST_ENABLE" | debconf-set-selections \ && curl -sSL https://packagecloud.io/dokku/dokku/gpgkey | apt-key add - \ - && echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ bionic main" | tee /etc/apt/sources.list.d/dokku.list \ + && echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ focal main" | tee /etc/apt/sources.list.d/dokku.list \ && mkdir -p /etc/nginx/ \ && cp /tmp/dhparam.pem /etc/nginx/dhparam.pem \ && apt-get update \ From c134912d6a63e9df426c9cb9cef0f4c1914cfe81 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 8 Mar 2022 01:31:59 -0500 Subject: [PATCH 10/10] chore: ignore lintian errors --- deb.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deb.mk b/deb.mk index 049df7f73..9d1382bb6 100644 --- a/deb.mk +++ b/deb.mk @@ -49,4 +49,4 @@ endif cp debian/lintian-overrides /tmp/build-dokku/usr/share/lintian/overrides/dokku sed -i.bak "s/^Version: .*/Version: `cat /tmp/build-dokku/var/lib/dokku/STABLE_VERSION`/g" /tmp/build-dokku/DEBIAN/control && rm /tmp/build-dokku/DEBIAN/control.bak dpkg-deb --build /tmp/build-dokku "$(BUILD_DIRECTORY)/dokku_`cat /tmp/build-dokku/var/lib/dokku/VERSION`_$(DOKKU_ARCHITECTURE).deb" - lintian "$(BUILD_DIRECTORY)/dokku_`cat /tmp/build-dokku/var/lib/dokku/VERSION`_$(DOKKU_ARCHITECTURE).deb" + lintian "$(BUILD_DIRECTORY)/dokku_`cat /tmp/build-dokku/var/lib/dokku/VERSION`_$(DOKKU_ARCHITECTURE).deb" || true