Skip to content
This repository was archived by the owner on Feb 16, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
## Readme

If you would like to change our readme, please __**do not**__ directly edit the readme, as it is auto-generated on each commit.
Instead edit the [readme-vars.yml](https://github.com/linuxserver/docker-docker-compose/edit/master/readme-vars.yml).
Instead edit the [readme-vars.yml](https://github.com/linuxserver/docker-docker-compose/edit/v2/readme-vars.yml).

These variables are used in a template for our [Jenkins Builder](https://github.com/linuxserver/docker-jenkins-builder) as part of an ansible play.
Most of these variables are also carried over to [docs.linuxserver.io](https://docs.linuxserver.io)
Expand Down Expand Up @@ -115,7 +115,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64

## Update the changelog

If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-docker-compose/tree/master/root), add an entry to the changelog
If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-docker-compose/tree/v2/root), add an entry to the changelog

```yml
changelogs:
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

------------------------------

- [ ] I have read the [contributing](https://github.com/linuxserver/docker-docker-compose/blob/master/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications
- [ ] I have read the [contributing](https://github.com/linuxserver/docker-docker-compose/blob/v2/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications

------------------------------

Expand Down
25 changes: 13 additions & 12 deletions .github/workflows/external_trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,25 @@ on:
workflow_dispatch:

jobs:
external-trigger-master:
external-trigger-v2:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.3

- name: External Trigger
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/v2'
run: |
if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_DOCKER_COMPOSE_MASTER }}" ]; then
echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_DOCKER_COMPOSE_MASTER is set; skipping trigger. ****"
if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_DOCKER_COMPOSE_V2 }}" ]; then
echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_DOCKER_COMPOSE_V2 is set; skipping trigger. ****"
exit 0
fi
echo "**** External trigger running off of master branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_DOCKER_COMPOSE_MASTER\". ****"
echo "**** External trigger running off of v2 branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_DOCKER_COMPOSE_V2\". ****"
echo "**** Retrieving external version ****"
EXT_RELEASE=$(curl -u "${{ secrets.CR_USER }}:${{ secrets.CR_PAT }}" -sX GET "https://api.github.com/repos/docker/compose/releases/latest" | jq -r '. | .tag_name')
EXT_RELEASE=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
&& awk '/^P:'"docker-cli-compose"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://')
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
echo "**** Can't retrieve external version, exiting ****"
FAILURE_REASON="Can't retrieve external version for docker-compose branch master"
FAILURE_REASON="Can't retrieve external version for docker-compose branch v2"
GHA_TRIGGER_URL="https://github.com/linuxserver/docker-docker-compose/actions/runs/${{ github.run_id }}"
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n**Trigger URL:** '"${GHA_TRIGGER_URL}"' \n"}],
Expand All @@ -32,7 +33,7 @@ jobs:
echo "**** External version: ${EXT_RELEASE} ****"
echo "**** Retrieving last pushed version ****"
image="linuxserver/docker-compose"
tag="latest"
tag="v2"
token=$(curl -sX GET \
"https://ghcr.io/token?scope=repository%3Alinuxserver%2Fdocker-compose%3Apull" \
| jq -r '.token')
Expand All @@ -54,7 +55,7 @@ jobs:
IMAGE_VERSION=$(echo ${IMAGE_RELEASE} | awk -F'-ls' '{print $1}')
if [ -z "${IMAGE_VERSION}" ]; then
echo "**** Can't retrieve last pushed version, exiting ****"
FAILURE_REASON="Can't retrieve last pushed version for docker-compose tag latest"
FAILURE_REASON="Can't retrieve last pushed version for docker-compose tag v2"
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
Expand All @@ -64,13 +65,13 @@ jobs:
if [ "${EXT_RELEASE}" == "${IMAGE_VERSION}" ]; then
echo "**** Version ${EXT_RELEASE} already pushed, exiting ****"
exit 0
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-docker-compose/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-docker-compose/job/v2/lastBuild/api/json | jq -r '.building') == "true" ]; then
echo "**** New version ${EXT_RELEASE} found; but there already seems to be an active build on Jenkins; exiting ****"
exit 0
else
echo "**** New version ${EXT_RELEASE} found; old version was ${IMAGE_VERSION}. Triggering new build ****"
response=$(curl -iX POST \
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-docker-compose/job/master/buildWithParameters?PACKAGE_CHECK=false \
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-docker-compose/job/v2/buildWithParameters?PACKAGE_CHECK=false \
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
echo "**** Sleeping 10 seconds until job starts ****"
Expand All @@ -85,7 +86,7 @@ jobs:
--data-urlencode "description=GHA external trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
--data-urlencode "Submit=Submit"
echo "**** Notifying Discord ****"
TRIGGER_REASON="A version change was detected for docker-compose tag latest. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}"
TRIGGER_REASON="A version change was detected for docker-compose tag v2. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}"
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
"description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n**Build URL:** '"${buildurl}display/redirect"' \n"}],
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ jobs:
steps:
- uses: actions/first-interaction@v1
with:
issue-message: 'Thanks for opening your first issue here! Be sure to follow the [bug](https://github.com/linuxserver/docker-docker-compose/blob/master/.github/ISSUE_TEMPLATE/issue.bug.md) or [feature](https://github.com/linuxserver/docker-docker-compose/blob/master/.github/ISSUE_TEMPLATE/issue.feature.md) issue templates!'
pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-docker-compose/blob/master/.github/PULL_REQUEST_TEMPLATE.md)!'
issue-message: 'Thanks for opening your first issue here! Be sure to follow the [bug](https://github.com/linuxserver/docker-docker-compose/blob/v2/.github/ISSUE_TEMPLATE/issue.bug.md) or [feature](https://github.com/linuxserver/docker-docker-compose/blob/v2/.github/ISSUE_TEMPLATE/issue.feature.md) issue templates!'
pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-docker-compose/blob/v2/.github/PULL_REQUEST_TEMPLATE.md)!'
repo-token: ${{ secrets.GITHUB_TOKEN }}
14 changes: 7 additions & 7 deletions .github/workflows/package_trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@ on:
workflow_dispatch:

jobs:
package-trigger-master:
package-trigger-v2:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.3

- name: Package Trigger
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/v2'
run: |
if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_DOCKER_COMPOSE_MASTER }}" ]; then
echo "**** Github secret PAUSE_PACKAGE_TRIGGER_DOCKER_COMPOSE_MASTER is set; skipping trigger. ****"
if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_DOCKER_COMPOSE_V2 }}" ]; then
echo "**** Github secret PAUSE_PACKAGE_TRIGGER_DOCKER_COMPOSE_V2 is set; skipping trigger. ****"
exit 0
fi
if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-docker-compose/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then
if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-docker-compose/job/v2/lastBuild/api/json | jq -r '.building') == "true" ]; then
echo "**** There already seems to be an active build on Jenkins; skipping package trigger ****"
exit 0
fi
echo "**** Package trigger running off of master branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_DOCKER_COMPOSE_MASTER\". ****"
echo "**** Package trigger running off of v2 branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_DOCKER_COMPOSE_V2\". ****"
response=$(curl -iX POST \
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-docker-compose/job/master/buildWithParameters?PACKAGE_CHECK=true \
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-docker-compose/job/v2/buildWithParameters?PACKAGE_CHECK=true \
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
echo "**** Sleeping 10 seconds until job starts ****"
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/publish_binaries.yml

This file was deleted.

75 changes: 18 additions & 57 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,63 +1,24 @@
ARG DOCKER_VERSION=19.03

FROM docker:${DOCKER_VERSION} AS docker-cli

FROM ghcr.io/linuxserver/baseimage-ubuntu:bionic AS build

ARG COMPOSE_VERSION

RUN apt-get update && apt-get install --no-install-recommends -y \
curl \
gcc \
git \
libc-dev \
libffi-dev \
libgcc-6-dev \
libssl-dev \
make \
openssl \
python3-dev \
python3-pip \
zlib1g-dev

COPY --from=docker-cli /usr/local/bin/docker /usr/local/bin/docker

RUN \
mkdir -p /compose && \
if [ -z ${COMPOSE_VERSION+x} ]; then \
COMPOSE_VERSION=$(curl -sX GET "https://api.github.com/repos/docker/compose/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
git clone https://github.com/docker/compose.git && \
cd /compose && \
git checkout "${COMPOSE_VERSION}" && \
pip3 install -U pip && \
pip install -U --ignore-installed \
virtualenv \
tox && \
PY_ARG=$(printf "$(python3 -V)" | awk '{print $2}' | awk 'BEGIN{FS=OFS="."} NF--' | sed 's|\.||g' | sed 's|^|py|g') && \
sed -i "s|envlist = .*|envlist = ${PY_ARG},pre-commit|g" tox.ini && \
tox --notest && \
mkdir -p dist && \
chmod 777 dist && \
/compose/.tox/${PY_ARG}/bin/pip3 install -q -r requirements-build.txt && \
echo "$(script/build/write-git-sha)" > compose/GITSHA && \
export PATH="/compose/pyinstaller:${PATH}" && \
/compose/.tox/${PY_ARG}/bin/pyinstaller --exclude-module pycrypto --exclude-module PyInstaller docker-compose.spec && \
ls -la dist/ && \
ldd dist/docker-compose && \
mv dist/docker-compose /usr/local/bin && \
docker-compose version

############## runtime stage ##############
FROM ghcr.io/linuxserver/baseimage-ubuntu:bionic
FROM ghcr.io/linuxserver/baseimage-alpine:edge

ARG BUILD_DATE
ARG VERSION
ARG COMPOSE_VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="aptalca"
LABEL maintainer="TheSpad"

RUN \
echo "**** install packages ****" && \
apk add -U --upgrade --no-cache \
curl && \
if [ -z ${COMPOSE_VERSION+x} ]; then \
COMPOSE_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
&& awk '/^P:docker-cli-compose$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
fi && \
apk add -U --upgrade --no-cache \
docker-cli \
docker-cli-compose==${COMPOSE_VERSION} && \
docker compose version

COPY ./docker-compose-entrypoint.sh /usr/local/bin/docker-compose-entrypoint.sh

COPY --from=build /compose/docker-compose-entrypoint.sh /usr/local/bin/docker-compose-entrypoint.sh
COPY --from=docker-cli /usr/local/bin/docker /usr/local/bin/docker
COPY --from=build /usr/local/bin/docker-compose /usr/local/bin/docker-compose
ENTRYPOINT ["sh", "/usr/local/bin/docker-compose-entrypoint.sh"]
75 changes: 18 additions & 57 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -1,63 +1,24 @@
ARG DOCKER_VERSION=19.03

FROM arm64v8/docker:${DOCKER_VERSION} AS docker-cli

FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-bionic AS build

ARG COMPOSE_VERSION

RUN apt-get update && apt-get install --no-install-recommends -y \
curl \
gcc \
git \
libc-dev \
libffi-dev \
libgcc-6-dev \
libssl-dev \
make \
openssl \
python3-dev \
python3-pip \
zlib1g-dev

COPY --from=docker-cli /usr/local/bin/docker /usr/local/bin/docker

RUN \
mkdir -p /compose && \
if [ -z ${COMPOSE_VERSION+x} ]; then \
COMPOSE_VERSION=$(curl -sX GET "https://api.github.com/repos/docker/compose/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
git clone https://github.com/docker/compose.git && \
cd /compose && \
git checkout "${COMPOSE_VERSION}" && \
pip3 install -U pip && \
pip install -U --ignore-installed \
virtualenv \
tox && \
PY_ARG=$(printf "$(python3 -V)" | awk '{print $2}' | awk 'BEGIN{FS=OFS="."} NF--' | sed 's|\.||g' | sed 's|^|py|g') && \
sed -i "s|envlist = .*|envlist = ${PY_ARG},pre-commit|g" tox.ini && \
tox --notest && \
mkdir -p dist && \
chmod 777 dist && \
/compose/.tox/${PY_ARG}/bin/pip3 install -q -r requirements-build.txt && \
echo "$(script/build/write-git-sha)" > compose/GITSHA && \
export PATH="/compose/pyinstaller:${PATH}" && \
/compose/.tox/${PY_ARG}/bin/pyinstaller --exclude-module pycrypto --exclude-module PyInstaller docker-compose.spec && \
ls -la dist/ && \
ldd dist/docker-compose && \
mv dist/docker-compose /usr/local/bin && \
docker-compose version

############## runtime stage ##############
FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-bionic
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-edge

ARG BUILD_DATE
ARG VERSION
ARG COMPOSE_VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="aptalca"
LABEL maintainer="TheSpad"

RUN \
echo "**** install packages ****" && \
apk add -U --upgrade --no-cache \
curl && \
if [ -z ${COMPOSE_VERSION+x} ]; then \
COMPOSE_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
&& awk '/^P:docker-cli-compose$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
fi && \
apk add -U --upgrade --no-cache \
docker-cli \
docker-cli-compose==${COMPOSE_VERSION} && \
docker compose version

COPY ./docker-compose-entrypoint.sh /usr/local/bin/docker-compose-entrypoint.sh

COPY --from=build /compose/docker-compose-entrypoint.sh /usr/local/bin/docker-compose-entrypoint.sh
COPY --from=docker-cli /usr/local/bin/docker /usr/local/bin/docker
COPY --from=build /usr/local/bin/docker-compose /usr/local/bin/docker-compose
ENTRYPOINT ["sh", "/usr/local/bin/docker-compose-entrypoint.sh"]
Loading