You've already forked docker-compose-docker
Compare commits
1 Commits
v5.0.0
...
d6bcb19d42
| Author | SHA1 | Date | |
|---|---|---|---|
|
d6bcb19d42
|
@@ -4,7 +4,7 @@ on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
paths:
|
||||
- Dockerfile
|
||||
- Makefile
|
||||
|
||||
env:
|
||||
GIT_EMAIL: noreply@cryptic.systems
|
||||
@@ -14,10 +14,9 @@ jobs:
|
||||
tag_on_change:
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.1
|
||||
- uses: actions/checkout@v5.0.0
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -26,8 +25,8 @@ jobs:
|
||||
run: |
|
||||
echo "changed=false" >> $GITHUB_OUTPUT
|
||||
|
||||
for file in Dockerfile; do
|
||||
if git diff HEAD~1 HEAD -- "${file}" | grep --quiet '^[+-]ARG DC_VERSION'; then
|
||||
for file in Makefile; do
|
||||
if git diff HEAD~1 HEAD -- "${file}" | grep --quiet '^[+-]DC_VERSION'; then
|
||||
echo "DC_VERSION line changed."
|
||||
echo "changed=true" >> $GITHUB_OUTPUT
|
||||
break
|
||||
@@ -39,10 +38,9 @@ jobs:
|
||||
run: echo "No DC_VERSION change. Exiting..."
|
||||
|
||||
- name: Create and push new tag
|
||||
id: create_tag
|
||||
if: steps.check_change.outputs.changed == 'true'
|
||||
run: |
|
||||
defined_tag="$(grep --only-matching --perl-regexp 'ARG DC_VERSION=v?[\d]*(\.[\d]*){0,2}' Dockerfile | cut --delimiter='=' --fields=2)"
|
||||
defined_tag="$(grep --only-matching --perl-regexp 'DC_VERSION\?=v?[\d]*(\.[\d]*){0,2}' Makefile | cut --delimiter='=' --fields=2)"
|
||||
|
||||
echo "defined_tag=${defined_tag}" >> $GITHUB_OUTPUT
|
||||
echo "New tag: ${defined_tag}"
|
||||
@@ -54,19 +52,12 @@ jobs:
|
||||
|
||||
- name: Trigger "Push tagged images" workflow
|
||||
if: steps.check_change.outputs.changed == 'true'
|
||||
uses: actions/github-script@v8.0.0
|
||||
uses: peter-evans/repository-dispatch@v4.0.0
|
||||
with:
|
||||
script: |
|
||||
const workflowFileName = 'release.yaml';
|
||||
const defaultBranch = context.payload.repository.default_branch;
|
||||
const definedTag = '${{ steps.create_tag.outputs.defined_tag }}';
|
||||
|
||||
await github.rest.actions.createWorkflowDispatch({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
workflow_id: workflowFileName,
|
||||
ref: defaultBranch,
|
||||
inputs: {
|
||||
tag: definedTag
|
||||
}
|
||||
});
|
||||
client-payload: |
|
||||
{
|
||||
"tag": "${{ steps.bump.outputs.defined_tag }}"
|
||||
}
|
||||
event-type: push-tagged-images
|
||||
repository: ${{ github.repository }}
|
||||
token: ${{ github.token }}
|
||||
|
||||
@@ -3,9 +3,9 @@ name: Build
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
- synchronize
|
||||
- "opened"
|
||||
- "reopened"
|
||||
- "synchronize"
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
@@ -15,8 +15,8 @@ jobs:
|
||||
build-arm64:
|
||||
runs-on: ubuntu-latest-arm64
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.1
|
||||
- uses: docker/setup-qemu-action@v3.7.0
|
||||
- uses: actions/checkout@v5.0.0
|
||||
- uses: docker/setup-qemu-action@v3.6.0
|
||||
- uses: docker/setup-buildx-action@v3.11.1
|
||||
|
||||
- name: Build image
|
||||
@@ -24,6 +24,9 @@ jobs:
|
||||
TAG=latest
|
||||
|
||||
docker buildx build \
|
||||
--build-arg GONOSUMDB=${GONOSUMDB} \
|
||||
--build-arg GOPRIVATE=${GOPRIVATE} \
|
||||
--build-arg GOPROXY=${GOPROXY} \
|
||||
--platform linux/arm64 \
|
||||
--file Dockerfile \
|
||||
--provenance false \
|
||||
@@ -33,8 +36,8 @@ jobs:
|
||||
build-amd64:
|
||||
runs-on: ubuntu-latest-amd64
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.1
|
||||
- uses: docker/setup-qemu-action@v3.7.0
|
||||
- uses: actions/checkout@v5.0.0
|
||||
- uses: docker/setup-qemu-action@v3.6.0
|
||||
- uses: docker/setup-buildx-action@v3.11.1
|
||||
|
||||
- name: Build image
|
||||
@@ -42,6 +45,9 @@ jobs:
|
||||
TAG=latest
|
||||
|
||||
docker buildx build \
|
||||
--build-arg GONOSUMDB=${GONOSUMDB} \
|
||||
--build-arg GOPRIVATE=${GOPRIVATE} \
|
||||
--build-arg GOPROXY=${GOPROXY} \
|
||||
--platform linux/amd64 \
|
||||
--file Dockerfile \
|
||||
--provenance false \
|
||||
|
||||
@@ -15,7 +15,7 @@ jobs:
|
||||
markdown-lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.1
|
||||
- uses: DavidAnson/markdownlint-cli2-action@v21.0.0
|
||||
- uses: actions/checkout@v5.0.0
|
||||
- uses: DavidAnson/markdownlint-cli2-action@v19.1.0
|
||||
with:
|
||||
globs: '**/*.md'
|
||||
|
||||
@@ -4,12 +4,8 @@ on:
|
||||
push:
|
||||
tags:
|
||||
- "**"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: "Tag which should be released"
|
||||
type: string
|
||||
required: true
|
||||
repository_dispatch:
|
||||
types: [ push-tagged-images ]
|
||||
|
||||
jobs:
|
||||
push-arm64:
|
||||
@@ -18,21 +14,17 @@ jobs:
|
||||
- id: version_extraction
|
||||
name: Extract git tag
|
||||
run: |
|
||||
VERSION="${{ inputs.tag || github.ref_name }}"
|
||||
VERSION="${{ github.event.client_payload.tag || github.ref_name }}"
|
||||
VERSION="${VERSION#refs/*/}"
|
||||
echo "Version: ${VERSION}"
|
||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||
|
||||
echo "Version (raw): ${VERSION}"
|
||||
echo "Version (cleaned): ${VERSION/v/}"
|
||||
|
||||
echo "version_raw=${VERSION}" >> $GITHUB_OUTPUT
|
||||
echo "version_cleaned=${VERSION/v/}" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: actions/checkout@v6.0.1
|
||||
- uses: actions/checkout@v5.0.0
|
||||
with:
|
||||
fetch-tags: true
|
||||
ref: "${{ steps.version_extraction.outputs.version_raw }}"
|
||||
ref: "${{ steps.version_extraction.outputs.version }}"
|
||||
|
||||
- uses: docker/setup-qemu-action@v3.7.0
|
||||
- uses: docker/setup-qemu-action@v3.6.0
|
||||
- uses: docker/setup-buildx-action@v3.11.1
|
||||
|
||||
- uses: docker/login-action@v3.6.0
|
||||
@@ -44,12 +36,14 @@ jobs:
|
||||
- name: Build and push image
|
||||
run: |
|
||||
docker buildx build \
|
||||
--build-arg DC_VERSION=${{ steps.version_extraction.outputs.version_raw }} \
|
||||
--file Dockerfile \
|
||||
--build-arg GONOSUMDB=${GONOSUMDB} \
|
||||
--build-arg GOPRIVATE=${GOPRIVATE} \
|
||||
--build-arg GOPROXY=${GOPROXY} \
|
||||
--platform linux/arm64 \
|
||||
--file Dockerfile \
|
||||
--provenance false \
|
||||
--tag git.cryptic.systems/volker.raschek/docker-compose:${{ steps.version_extraction.outputs.version }}-arm64 \
|
||||
--push \
|
||||
--tag git.cryptic.systems/volker.raschek/docker-compose:${{ steps.version_extraction.outputs.version_cleaned }}-arm64 \
|
||||
.
|
||||
|
||||
push-amd64:
|
||||
@@ -58,21 +52,17 @@ jobs:
|
||||
- id: version_extraction
|
||||
name: Extract git tag
|
||||
run: |
|
||||
VERSION="${{ inputs.tag || github.ref_name }}"
|
||||
VERSION="${{ github.event.client_payload.tag || github.ref_name }}"
|
||||
VERSION="${VERSION#refs/*/}"
|
||||
echo "Version: ${VERSION}"
|
||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||
|
||||
echo "Version (raw): ${VERSION}"
|
||||
echo "Version (cleaned): ${VERSION/v/}"
|
||||
|
||||
echo "version_raw=${VERSION}" >> $GITHUB_OUTPUT
|
||||
echo "version_cleaned=${VERSION/v/}" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: actions/checkout@v6.0.1
|
||||
- uses: actions/checkout@v5.0.0
|
||||
with:
|
||||
fetch-tags: true
|
||||
ref: "${{ steps.version_extraction.outputs.version_raw }}"
|
||||
ref: "${{ steps.version_extraction.outputs.version }}"
|
||||
|
||||
- uses: docker/setup-qemu-action@v3.7.0
|
||||
- uses: docker/setup-qemu-action@v3.6.0
|
||||
- uses: docker/setup-buildx-action@v3.11.1
|
||||
|
||||
- uses: docker/login-action@v3.6.0
|
||||
@@ -84,12 +74,14 @@ jobs:
|
||||
- name: Build and push image
|
||||
run: |
|
||||
docker buildx build \
|
||||
--build-arg DC_VERSION=${{ steps.version_extraction.outputs.version_raw }} \
|
||||
--file Dockerfile \
|
||||
--build-arg GONOSUMDB=${GONOSUMDB} \
|
||||
--build-arg GOPRIVATE=${GOPRIVATE} \
|
||||
--build-arg GOPROXY=${GOPROXY} \
|
||||
--platform linux/amd64 \
|
||||
--file Dockerfile \
|
||||
--provenance false \
|
||||
--tag git.cryptic.systems/volker.raschek/docker-compose:${{ steps.version_extraction.outputs.version }}-amd64 \
|
||||
--push \
|
||||
--tag git.cryptic.systems/volker.raschek/docker-compose:${{ steps.version_extraction.outputs.version_cleaned }}-amd64 \
|
||||
.
|
||||
|
||||
push-manifest:
|
||||
@@ -101,14 +93,10 @@ jobs:
|
||||
- id: version_extraction
|
||||
name: Extract git tag
|
||||
run: |
|
||||
VERSION="${{ inputs.tag || github.ref_name }}"
|
||||
VERSION="${{ github.event.client_payload.tag || github.ref_name }}"
|
||||
VERSION="${VERSION#refs/*/}"
|
||||
|
||||
echo "Version (raw): ${VERSION}"
|
||||
echo "Version (cleaned): ${VERSION/v/}"
|
||||
|
||||
echo "version_raw=${VERSION}" >> $GITHUB_OUTPUT
|
||||
echo "version_cleaned=${VERSION/v/}" >> $GITHUB_OUTPUT
|
||||
echo "Version: ${VERSION}"
|
||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: docker/login-action@v3.6.0
|
||||
with:
|
||||
@@ -118,11 +106,11 @@ jobs:
|
||||
|
||||
- name: Create and push manifest
|
||||
run: |
|
||||
docker manifest create git.cryptic.systems/volker.raschek/docker-compose:${{ steps.version_extraction.outputs.version_cleaned }} \
|
||||
--amend git.cryptic.systems/volker.raschek/docker-compose:${{ steps.version_extraction.outputs.version_cleaned }}-amd64 \
|
||||
--amend git.cryptic.systems/volker.raschek/docker-compose:${{ steps.version_extraction.outputs.version_cleaned }}-arm64
|
||||
docker manifest create git.cryptic.systems/volker.raschek/docker-compose:${{ steps.version_extraction.outputs.version }} \
|
||||
--amend git.cryptic.systems/volker.raschek/docker-compose:${{ steps.version_extraction.outputs.version }}-amd64 \
|
||||
--amend git.cryptic.systems/volker.raschek/docker-compose:${{ steps.version_extraction.outputs.version }}-arm64
|
||||
|
||||
docker manifest push git.cryptic.systems/volker.raschek/docker-compose:${{ steps.version_extraction.outputs.version_cleaned }}
|
||||
docker manifest push git.cryptic.systems/volker.raschek/docker-compose:${{ steps.version_extraction.outputs.version }}
|
||||
|
||||
sync-to-hub-docker-io:
|
||||
needs:
|
||||
@@ -132,17 +120,15 @@ jobs:
|
||||
- id: version_extraction
|
||||
name: Extract git tag
|
||||
run: |
|
||||
VERSION="${{ inputs.tag || github.ref_name }}"
|
||||
VERSION="${{ github.event.client_payload.tag || github.ref_name }}"
|
||||
VERSION="${VERSION#refs/*/}"
|
||||
|
||||
echo "Version (raw): ${VERSION}"
|
||||
echo "Version (cleaned): ${VERSION/v/}"
|
||||
|
||||
echo "version_raw=${VERSION}" >> $GITHUB_OUTPUT
|
||||
echo "version_cleaned=${VERSION/v/}" >> $GITHUB_OUTPUT
|
||||
echo "Version: ${VERSION}"
|
||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Copy images to docker.io
|
||||
run: |
|
||||
TAG=$(echo ${{ github.ref_name }} | sed 's/v//gm')
|
||||
|
||||
apt-get update --yes
|
||||
apt-get install --yes skopeo
|
||||
skopeo copy \
|
||||
@@ -151,5 +137,5 @@ jobs:
|
||||
--dest-username ${{ secrets.DOCKER_IO_USERNAME }} \
|
||||
--src-password ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }} \
|
||||
--src-username volker.raschek \
|
||||
docker://git.cryptic.systems/volker.raschek/docker-compose:${{ steps.version_extraction.outputs.version_cleaned }} \
|
||||
docker://docker.io/volkerraschek/docker-compose:${{ steps.version_extraction.outputs.version_cleaned }}
|
||||
docker://git.cryptic.systems/volker.raschek/docker-compose:${{ steps.version_extraction.outputs.version }} \
|
||||
docker://docker.io/volkerraschek/docker-compose:${{ steps.version_extraction.outputs.version }}
|
||||
@@ -10,9 +10,10 @@ on:
|
||||
|
||||
jobs:
|
||||
update-description-on-hub-docker-io:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on:
|
||||
- ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.1
|
||||
- uses: actions/checkout@v5.0.0
|
||||
- uses: peter-evans/dockerhub-description@v5.0.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_IO_USERNAME }}
|
||||
|
||||
34
Dockerfile
34
Dockerfile
@@ -1,23 +1,21 @@
|
||||
FROM docker.io/library/ubuntu:24.04 AS download
|
||||
FROM docker.io/library/golang:1.25.3-alpine3.21 AS build
|
||||
|
||||
ARG DC_VERSION=v5.0.0
|
||||
ARG DC_VERSION=main
|
||||
ARG GONOSUMDB
|
||||
ARG GOPRIVATE
|
||||
ARG GOPROXY
|
||||
|
||||
RUN NAME=docker-compose-$(uname | tr [:upper:] [:lower:])-$(uname -m); \
|
||||
apt update --yes && \
|
||||
apt install --yes curl && \
|
||||
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 set -ex && \
|
||||
apk update && \
|
||||
apk upgrade && \
|
||||
apk add git make
|
||||
|
||||
FROM scratch
|
||||
RUN git clone https://github.com/docker/compose.git --branch ${DC_VERSION} docker-compose && \
|
||||
cd docker-compose && \
|
||||
make DESTDIR=/cache
|
||||
|
||||
FROM docker.io/library/alpine:3.22
|
||||
|
||||
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" ]
|
||||
|
||||
13
Makefile
13
Makefile
@@ -1,3 +1,7 @@
|
||||
# DC_VERSION
|
||||
# Only required to install a specify version
|
||||
DC_VERSION?=v2.40.2 # renovate: datasource=github-releases depName=docker/compose
|
||||
|
||||
# CONTAINER_RUNTIME
|
||||
# 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.
|
||||
@@ -13,11 +17,20 @@ DC_IMAGE_NAME:=docker-compose
|
||||
DC_IMAGE_VERSION?=latest
|
||||
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
|
||||
# =====================================================================================================================
|
||||
PHONY:=container-image/build
|
||||
container-image/build:
|
||||
${CONTAINER_RUNTIME} build \
|
||||
--build-arg DC_VERSION=${DC_VERSION} \
|
||||
--build-arg GONOSUMDB=${GONOSUMDB} \
|
||||
--build-arg GOPRIVATE=${GOPRIVATE} \
|
||||
--build-arg GOPROXY=${GOPROXY} \
|
||||
--file Dockerfile \
|
||||
--no-cache \
|
||||
--pull \
|
||||
|
||||
10
README.md
10
README.md
@@ -11,12 +11,12 @@ The workflow or how `docker-compose` can in general be used is documented at
|
||||
image.
|
||||
|
||||
```bash
|
||||
IMAGE_VERSION=5.0.0
|
||||
IMAGE_VERSION=2.40.2
|
||||
docker run \
|
||||
--rm \
|
||||
--volume "$(pwd):$(pwd)" \
|
||||
--volume ./path/to/docker-compose.yml:/workdir/docker-compose.yml:ro \
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock \
|
||||
--workdir "$(pwd)" \
|
||||
"git.cryptic.systems/volker.raschek/docker-compose:${IMAGE_VERSION}" \
|
||||
version
|
||||
--workdir /workdir \
|
||||
git.cryptic.systems/volker.raschek/docker-compose:${IMAGE_VERSION} \
|
||||
ps
|
||||
```
|
||||
|
||||
@@ -4,11 +4,9 @@
|
||||
{
|
||||
"customType": "regex",
|
||||
"fileMatch": [
|
||||
"^Dockerfile$",
|
||||
"^README\\.md$"
|
||||
],
|
||||
"matchStrings": [
|
||||
"ARG DC_VERSION=(?<currentValue>.*)",
|
||||
"IMAGE_VERSION=(?<currentValue>.*)"
|
||||
],
|
||||
"datasourceTemplate": "github-releases",
|
||||
@@ -33,10 +31,6 @@
|
||||
],
|
||||
"matchManagers": [
|
||||
"regex"
|
||||
],
|
||||
"matchUpdateTypes": [
|
||||
"minor",
|
||||
"patch"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user