Skip to content
This repository was archived by the owner on Feb 16, 2023. It is now read-only.

Commit 7937cb9

Browse files
authored
Merge pull request #30 from linuxserver/v2-initial
Intial v2 commit
2 parents 7c4cd0a + 7ff1326 commit 7937cb9

15 files changed

+363
-375
lines changed

.github/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
## Readme
2525

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

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

116116
## Update the changelog
117117

118-
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
118+
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
119119

120120
```yml
121121
changelogs:

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
------------------------------
2323

24-
- [ ] 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
24+
- [ ] 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
2525

2626
------------------------------
2727

.github/workflows/external_trigger.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,25 @@ on:
44
workflow_dispatch:
55

66
jobs:
7-
external-trigger-master:
7+
external-trigger-v2:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v2.3.3
1111

1212
- name: External Trigger
13-
if: github.ref == 'refs/heads/master'
13+
if: github.ref == 'refs/heads/v2'
1414
run: |
15-
if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_DOCKER_COMPOSE_MASTER }}" ]; then
16-
echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_DOCKER_COMPOSE_MASTER is set; skipping trigger. ****"
15+
if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_DOCKER_COMPOSE_V2 }}" ]; then
16+
echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_DOCKER_COMPOSE_V2 is set; skipping trigger. ****"
1717
exit 0
1818
fi
19-
echo "**** External trigger running off of master branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_DOCKER_COMPOSE_MASTER\". ****"
19+
echo "**** External trigger running off of v2 branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_DOCKER_COMPOSE_V2\". ****"
2020
echo "**** Retrieving external version ****"
21-
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')
21+
EXT_RELEASE=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
22+
&& awk '/^P:'"docker-cli-compose"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://')
2223
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
2324
echo "**** Can't retrieve external version, exiting ****"
24-
FAILURE_REASON="Can't retrieve external version for docker-compose branch master"
25+
FAILURE_REASON="Can't retrieve external version for docker-compose branch v2"
2526
GHA_TRIGGER_URL="https://github.com/linuxserver/docker-docker-compose/actions/runs/${{ github.run_id }}"
2627
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
2728
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n**Trigger URL:** '"${GHA_TRIGGER_URL}"' \n"}],
@@ -32,7 +33,7 @@ jobs:
3233
echo "**** External version: ${EXT_RELEASE} ****"
3334
echo "**** Retrieving last pushed version ****"
3435
image="linuxserver/docker-compose"
35-
tag="latest"
36+
tag="v2"
3637
token=$(curl -sX GET \
3738
"https://ghcr.io/token?scope=repository%3Alinuxserver%2Fdocker-compose%3Apull" \
3839
| jq -r '.token')
@@ -54,7 +55,7 @@ jobs:
5455
IMAGE_VERSION=$(echo ${IMAGE_RELEASE} | awk -F'-ls' '{print $1}')
5556
if [ -z "${IMAGE_VERSION}" ]; then
5657
echo "**** Can't retrieve last pushed version, exiting ****"
57-
FAILURE_REASON="Can't retrieve last pushed version for docker-compose tag latest"
58+
FAILURE_REASON="Can't retrieve last pushed version for docker-compose tag v2"
5859
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
5960
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
6061
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
@@ -64,13 +65,13 @@ jobs:
6465
if [ "${EXT_RELEASE}" == "${IMAGE_VERSION}" ]; then
6566
echo "**** Version ${EXT_RELEASE} already pushed, exiting ****"
6667
exit 0
67-
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
68+
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
6869
echo "**** New version ${EXT_RELEASE} found; but there already seems to be an active build on Jenkins; exiting ****"
6970
exit 0
7071
else
7172
echo "**** New version ${EXT_RELEASE} found; old version was ${IMAGE_VERSION}. Triggering new build ****"
7273
response=$(curl -iX POST \
73-
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-docker-compose/job/master/buildWithParameters?PACKAGE_CHECK=false \
74+
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-docker-compose/job/v2/buildWithParameters?PACKAGE_CHECK=false \
7475
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
7576
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
7677
echo "**** Sleeping 10 seconds until job starts ****"
@@ -85,7 +86,7 @@ jobs:
8586
--data-urlencode "description=GHA external trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
8687
--data-urlencode "Submit=Submit"
8788
echo "**** Notifying Discord ****"
88-
TRIGGER_REASON="A version change was detected for docker-compose tag latest. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}"
89+
TRIGGER_REASON="A version change was detected for docker-compose tag v2. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}"
8990
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
9091
"description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n**Build URL:** '"${buildurl}display/redirect"' \n"}],
9192
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}

.github/workflows/greetings.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ jobs:
88
steps:
99
- uses: actions/first-interaction@v1
1010
with:
11-
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!'
12-
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)!'
11+
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!'
12+
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)!'
1313
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/package_trigger.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@ on:
44
workflow_dispatch:
55

66
jobs:
7-
package-trigger-master:
7+
package-trigger-v2:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v2.3.3
1111

1212
- name: Package Trigger
13-
if: github.ref == 'refs/heads/master'
13+
if: github.ref == 'refs/heads/v2'
1414
run: |
15-
if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_DOCKER_COMPOSE_MASTER }}" ]; then
16-
echo "**** Github secret PAUSE_PACKAGE_TRIGGER_DOCKER_COMPOSE_MASTER is set; skipping trigger. ****"
15+
if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_DOCKER_COMPOSE_V2 }}" ]; then
16+
echo "**** Github secret PAUSE_PACKAGE_TRIGGER_DOCKER_COMPOSE_V2 is set; skipping trigger. ****"
1717
exit 0
1818
fi
19-
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
19+
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
2020
echo "**** There already seems to be an active build on Jenkins; skipping package trigger ****"
2121
exit 0
2222
fi
23-
echo "**** Package trigger running off of master branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_DOCKER_COMPOSE_MASTER\". ****"
23+
echo "**** Package trigger running off of v2 branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_DOCKER_COMPOSE_V2\". ****"
2424
response=$(curl -iX POST \
25-
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-docker-compose/job/master/buildWithParameters?PACKAGE_CHECK=true \
25+
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-docker-compose/job/v2/buildWithParameters?PACKAGE_CHECK=true \
2626
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
2727
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
2828
echo "**** Sleeping 10 seconds until job starts ****"

.github/workflows/publish_binaries.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

Dockerfile

Lines changed: 18 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,24 @@
1-
ARG DOCKER_VERSION=19.03
2-
3-
FROM docker:${DOCKER_VERSION} AS docker-cli
4-
5-
FROM ghcr.io/linuxserver/baseimage-ubuntu:bionic AS build
6-
7-
ARG COMPOSE_VERSION
8-
9-
RUN apt-get update && apt-get install --no-install-recommends -y \
10-
curl \
11-
gcc \
12-
git \
13-
libc-dev \
14-
libffi-dev \
15-
libgcc-6-dev \
16-
libssl-dev \
17-
make \
18-
openssl \
19-
python3-dev \
20-
python3-pip \
21-
zlib1g-dev
22-
23-
COPY --from=docker-cli /usr/local/bin/docker /usr/local/bin/docker
24-
25-
RUN \
26-
mkdir -p /compose && \
27-
if [ -z ${COMPOSE_VERSION+x} ]; then \
28-
COMPOSE_VERSION=$(curl -sX GET "https://api.github.com/repos/docker/compose/releases/latest" \
29-
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
30-
fi && \
31-
git clone https://github.com/docker/compose.git && \
32-
cd /compose && \
33-
git checkout "${COMPOSE_VERSION}" && \
34-
pip3 install -U pip && \
35-
pip install -U --ignore-installed \
36-
virtualenv \
37-
tox && \
38-
PY_ARG=$(printf "$(python3 -V)" | awk '{print $2}' | awk 'BEGIN{FS=OFS="."} NF--' | sed 's|\.||g' | sed 's|^|py|g') && \
39-
sed -i "s|envlist = .*|envlist = ${PY_ARG},pre-commit|g" tox.ini && \
40-
tox --notest && \
41-
mkdir -p dist && \
42-
chmod 777 dist && \
43-
/compose/.tox/${PY_ARG}/bin/pip3 install -q -r requirements-build.txt && \
44-
echo "$(script/build/write-git-sha)" > compose/GITSHA && \
45-
export PATH="/compose/pyinstaller:${PATH}" && \
46-
/compose/.tox/${PY_ARG}/bin/pyinstaller --exclude-module pycrypto --exclude-module PyInstaller docker-compose.spec && \
47-
ls -la dist/ && \
48-
ldd dist/docker-compose && \
49-
mv dist/docker-compose /usr/local/bin && \
50-
docker-compose version
51-
52-
############## runtime stage ##############
53-
FROM ghcr.io/linuxserver/baseimage-ubuntu:bionic
1+
FROM ghcr.io/linuxserver/baseimage-alpine:edge
542

553
ARG BUILD_DATE
564
ARG VERSION
5+
ARG COMPOSE_VERSION
576
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
58-
LABEL maintainer="aptalca"
7+
LABEL maintainer="TheSpad"
8+
9+
RUN \
10+
echo "**** install packages ****" && \
11+
apk add -U --upgrade --no-cache \
12+
curl && \
13+
if [ -z ${COMPOSE_VERSION+x} ]; then \
14+
COMPOSE_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
15+
&& awk '/^P:docker-cli-compose$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
16+
fi && \
17+
apk add -U --upgrade --no-cache \
18+
docker-cli \
19+
docker-cli-compose==${COMPOSE_VERSION} && \
20+
docker compose version
21+
22+
COPY ./docker-compose-entrypoint.sh /usr/local/bin/docker-compose-entrypoint.sh
5923

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

Dockerfile.aarch64

Lines changed: 18 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,24 @@
1-
ARG DOCKER_VERSION=19.03
2-
3-
FROM arm64v8/docker:${DOCKER_VERSION} AS docker-cli
4-
5-
FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-bionic AS build
6-
7-
ARG COMPOSE_VERSION
8-
9-
RUN apt-get update && apt-get install --no-install-recommends -y \
10-
curl \
11-
gcc \
12-
git \
13-
libc-dev \
14-
libffi-dev \
15-
libgcc-6-dev \
16-
libssl-dev \
17-
make \
18-
openssl \
19-
python3-dev \
20-
python3-pip \
21-
zlib1g-dev
22-
23-
COPY --from=docker-cli /usr/local/bin/docker /usr/local/bin/docker
24-
25-
RUN \
26-
mkdir -p /compose && \
27-
if [ -z ${COMPOSE_VERSION+x} ]; then \
28-
COMPOSE_VERSION=$(curl -sX GET "https://api.github.com/repos/docker/compose/releases/latest" \
29-
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
30-
fi && \
31-
git clone https://github.com/docker/compose.git && \
32-
cd /compose && \
33-
git checkout "${COMPOSE_VERSION}" && \
34-
pip3 install -U pip && \
35-
pip install -U --ignore-installed \
36-
virtualenv \
37-
tox && \
38-
PY_ARG=$(printf "$(python3 -V)" | awk '{print $2}' | awk 'BEGIN{FS=OFS="."} NF--' | sed 's|\.||g' | sed 's|^|py|g') && \
39-
sed -i "s|envlist = .*|envlist = ${PY_ARG},pre-commit|g" tox.ini && \
40-
tox --notest && \
41-
mkdir -p dist && \
42-
chmod 777 dist && \
43-
/compose/.tox/${PY_ARG}/bin/pip3 install -q -r requirements-build.txt && \
44-
echo "$(script/build/write-git-sha)" > compose/GITSHA && \
45-
export PATH="/compose/pyinstaller:${PATH}" && \
46-
/compose/.tox/${PY_ARG}/bin/pyinstaller --exclude-module pycrypto --exclude-module PyInstaller docker-compose.spec && \
47-
ls -la dist/ && \
48-
ldd dist/docker-compose && \
49-
mv dist/docker-compose /usr/local/bin && \
50-
docker-compose version
51-
52-
############## runtime stage ##############
53-
FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-bionic
1+
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-edge
542

553
ARG BUILD_DATE
564
ARG VERSION
5+
ARG COMPOSE_VERSION
576
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
58-
LABEL maintainer="aptalca"
7+
LABEL maintainer="TheSpad"
8+
9+
RUN \
10+
echo "**** install packages ****" && \
11+
apk add -U --upgrade --no-cache \
12+
curl && \
13+
if [ -z ${COMPOSE_VERSION+x} ]; then \
14+
COMPOSE_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
15+
&& awk '/^P:docker-cli-compose$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
16+
fi && \
17+
apk add -U --upgrade --no-cache \
18+
docker-cli \
19+
docker-cli-compose==${COMPOSE_VERSION} && \
20+
docker compose version
21+
22+
COPY ./docker-compose-entrypoint.sh /usr/local/bin/docker-compose-entrypoint.sh
5923

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

0 commit comments

Comments
 (0)