You've already forked docker-compose-docker
fix: prepare upgrade to docker-compose v5
The following downloads the finished docker-compose v5 binary and delivers it as a scratch container image.
This commit is contained in:
@@ -4,7 +4,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: [ "master" ]
|
branches: [ "master" ]
|
||||||
paths:
|
paths:
|
||||||
- Makefile
|
- Dockerfile
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GIT_EMAIL: noreply@cryptic.systems
|
GIT_EMAIL: noreply@cryptic.systems
|
||||||
@@ -26,8 +26,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "changed=false" >> $GITHUB_OUTPUT
|
echo "changed=false" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
for file in Makefile; do
|
for file in Dockerfile; do
|
||||||
if git diff HEAD~1 HEAD -- "${file}" | grep --quiet '^[+-]DC_VERSION'; then
|
if git diff HEAD~1 HEAD -- "${file}" | grep --quiet '^[+-]ARG DC_VERSION'; then
|
||||||
echo "DC_VERSION line changed."
|
echo "DC_VERSION line changed."
|
||||||
echo "changed=true" >> $GITHUB_OUTPUT
|
echo "changed=true" >> $GITHUB_OUTPUT
|
||||||
break
|
break
|
||||||
@@ -42,7 +42,7 @@ jobs:
|
|||||||
id: create_tag
|
id: create_tag
|
||||||
if: steps.check_change.outputs.changed == 'true'
|
if: steps.check_change.outputs.changed == 'true'
|
||||||
run: |
|
run: |
|
||||||
defined_tag="$(grep --only-matching --perl-regexp 'DC_VERSION\?=v?[\d]*(\.[\d]*){0,2}' Makefile | cut --delimiter='=' --fields=2)"
|
defined_tag="$(grep --only-matching --perl-regexp 'ARG DC_VERSION=v?[\d]*(\.[\d]*){0,2}' Dockerfile | cut --delimiter='=' --fields=2)"
|
||||||
|
|
||||||
echo "defined_tag=${defined_tag}" >> $GITHUB_OUTPUT
|
echo "defined_tag=${defined_tag}" >> $GITHUB_OUTPUT
|
||||||
echo "New tag: ${defined_tag}"
|
echo "New tag: ${defined_tag}"
|
||||||
|
|||||||
@@ -1,10 +1,5 @@
|
|||||||
name: Build
|
name: Build
|
||||||
|
|
||||||
env:
|
|
||||||
GONOSUMDB: ${{ vars.GONOSUMDB }}
|
|
||||||
GOPRIVATE: ${{ vars.GOPRIVATE }}
|
|
||||||
GOPROXY: ${{ vars.GOPROXY }}
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
@@ -29,9 +24,6 @@ jobs:
|
|||||||
TAG=latest
|
TAG=latest
|
||||||
|
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--build-arg GONOSUMDB=${GONOSUMDB} \
|
|
||||||
--build-arg GOPRIVATE=${GOPRIVATE} \
|
|
||||||
--build-arg GOPROXY=${GOPROXY} \
|
|
||||||
--platform linux/arm64 \
|
--platform linux/arm64 \
|
||||||
--file Dockerfile \
|
--file Dockerfile \
|
||||||
--provenance false \
|
--provenance false \
|
||||||
@@ -50,9 +42,6 @@ jobs:
|
|||||||
TAG=latest
|
TAG=latest
|
||||||
|
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--build-arg GONOSUMDB=${GONOSUMDB} \
|
|
||||||
--build-arg GOPRIVATE=${GOPRIVATE} \
|
|
||||||
--build-arg GOPROXY=${GOPROXY} \
|
|
||||||
--platform linux/amd64 \
|
--platform linux/amd64 \
|
||||||
--file Dockerfile \
|
--file Dockerfile \
|
||||||
--provenance false \
|
--provenance false \
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
name: Release
|
name: Release
|
||||||
|
|
||||||
env:
|
|
||||||
GOPROXY: ${{ vars.GOPROXY }}
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
@@ -48,9 +45,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--build-arg DC_VERSION=${{ steps.version_extraction.outputs.version_raw }} \
|
--build-arg DC_VERSION=${{ steps.version_extraction.outputs.version_raw }} \
|
||||||
--build-arg GONOSUMDB=${GONOSUMDB} \
|
|
||||||
--build-arg GOPRIVATE=${GOPRIVATE} \
|
|
||||||
--build-arg GOPROXY=${GOPROXY} \
|
|
||||||
--file Dockerfile \
|
--file Dockerfile \
|
||||||
--platform linux/arm64 \
|
--platform linux/arm64 \
|
||||||
--provenance false \
|
--provenance false \
|
||||||
@@ -91,9 +85,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--build-arg DC_VERSION=${{ steps.version_extraction.outputs.version_raw }} \
|
--build-arg DC_VERSION=${{ steps.version_extraction.outputs.version_raw }} \
|
||||||
--build-arg GONOSUMDB=${GONOSUMDB} \
|
|
||||||
--build-arg GOPRIVATE=${GOPRIVATE} \
|
|
||||||
--build-arg GOPROXY=${GOPROXY} \
|
|
||||||
--file Dockerfile \
|
--file Dockerfile \
|
||||||
--platform linux/amd64 \
|
--platform linux/amd64 \
|
||||||
--provenance false \
|
--provenance false \
|
||||||
|
|||||||
@@ -10,8 +10,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update-description-on-hub-docker-io:
|
update-description-on-hub-docker-io:
|
||||||
runs-on:
|
runs-on: ubuntu-latest
|
||||||
- ubuntu-latest
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6.0.1
|
- uses: actions/checkout@v6.0.1
|
||||||
- uses: peter-evans/dockerhub-description@v5.0.0
|
- uses: peter-evans/dockerhub-description@v5.0.0
|
||||||
|
|||||||
35
Dockerfile
35
Dockerfile
@@ -1,21 +1,24 @@
|
|||||||
FROM docker.io/library/golang:1.25.5-alpine3.21 AS build
|
FROM docker.io/library/ubuntu:24.04 AS download
|
||||||
|
|
||||||
ARG DC_VERSION=main
|
# renovate: datasource=github-releases depName=docker/compose
|
||||||
ARG GONOSUMDB
|
ARG DC_VERSION=v2.40.3
|
||||||
ARG GOPRIVATE
|
|
||||||
ARG GOPROXY
|
|
||||||
|
|
||||||
RUN set -ex && \
|
RUN NAME=docker-compose-$(uname | tr [:upper:] [:lower:])-$(uname -m); \
|
||||||
apk update && \
|
apt update --yes && \
|
||||||
apk upgrade && \
|
apt install --yes curl && \
|
||||||
apk add git make
|
curl \
|
||||||
|
--fail \
|
||||||
|
--output "/tmp/${NAME}" \
|
||||||
|
--location "https://github.com/docker/compose/releases/download/${DC_VERSION}/${NAME}" && \
|
||||||
|
curl \
|
||||||
|
--fail \
|
||||||
|
--output /tmp/checksums.txt \
|
||||||
|
--location "https://github.com/docker/compose/releases/download/${DC_VERSION}/checksums.txt" && \
|
||||||
|
(cd /tmp && sha256sum --ignore-missing --check checksums.txt) && \
|
||||||
|
ln -s "${NAME}" /tmp/docker-compose && \
|
||||||
|
chmod +x /tmp/docker-compose
|
||||||
|
|
||||||
RUN git clone https://github.com/docker/compose.git --branch ${DC_VERSION} docker-compose && \
|
FROM scratch
|
||||||
cd docker-compose && \
|
|
||||||
make DESTDIR=/cache
|
|
||||||
|
|
||||||
FROM docker.io/library/alpine:3.23
|
|
||||||
|
|
||||||
COPY --from=build /cache/docker-compose /usr/bin/docker-compose
|
|
||||||
|
|
||||||
|
COPY --from=download /tmp/docker-compose /usr/bin/docker-compose
|
||||||
ENTRYPOINT [ "/usr/bin/docker-compose" ]
|
ENTRYPOINT [ "/usr/bin/docker-compose" ]
|
||||||
|
|||||||
13
Makefile
13
Makefile
@@ -1,7 +1,3 @@
|
|||||||
# DC_VERSION
|
|
||||||
# Only required to install a specify version
|
|
||||||
DC_VERSION?=v2.40.3 # renovate: datasource=github-releases depName=docker/compose
|
|
||||||
|
|
||||||
# CONTAINER_RUNTIME
|
# CONTAINER_RUNTIME
|
||||||
# The CONTAINER_RUNTIME variable will be used to specified the path to a container runtime. This is needed to start and
|
# The CONTAINER_RUNTIME variable will be used to specified the path to a container runtime. This is needed to start and
|
||||||
# run a container image.
|
# run a container image.
|
||||||
@@ -17,20 +13,11 @@ DC_IMAGE_NAME:=docker-compose
|
|||||||
DC_IMAGE_VERSION?=latest
|
DC_IMAGE_VERSION?=latest
|
||||||
DC_IMAGE_FULLY_QUALIFIED=${DC_IMAGE_REGISTRY_NAME}/${DC_IMAGE_NAMESPACE}/${DC_IMAGE_NAME}:${DC_IMAGE_VERSION}
|
DC_IMAGE_FULLY_QUALIFIED=${DC_IMAGE_REGISTRY_NAME}/${DC_IMAGE_NAMESPACE}/${DC_IMAGE_NAME}:${DC_IMAGE_VERSION}
|
||||||
|
|
||||||
# Golang related environment variables
|
|
||||||
GONOSUMDB?=
|
|
||||||
GOPRIVATE?=
|
|
||||||
GOPROXY?=
|
|
||||||
|
|
||||||
# BUILD CONTAINER IMAGE
|
# BUILD CONTAINER IMAGE
|
||||||
# =====================================================================================================================
|
# =====================================================================================================================
|
||||||
PHONY:=container-image/build
|
PHONY:=container-image/build
|
||||||
container-image/build:
|
container-image/build:
|
||||||
${CONTAINER_RUNTIME} build \
|
${CONTAINER_RUNTIME} build \
|
||||||
--build-arg DC_VERSION=${DC_VERSION} \
|
|
||||||
--build-arg GONOSUMDB=${GONOSUMDB} \
|
|
||||||
--build-arg GOPRIVATE=${GOPRIVATE} \
|
|
||||||
--build-arg GOPROXY=${GOPROXY} \
|
|
||||||
--file Dockerfile \
|
--file Dockerfile \
|
||||||
--no-cache \
|
--no-cache \
|
||||||
--pull \
|
--pull \
|
||||||
|
|||||||
Reference in New Issue
Block a user