This repository has been archived by the owner on Sep 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Breaking the image up into a base image with a few other examples
- Loading branch information
1 parent
abf4918
commit ce170a0
Showing
12 changed files
with
414 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: Docker-push | ||
|
||
on: | ||
push: | ||
# Publish `v1.2.3` tags as releases. | ||
tags: | ||
- v* | ||
env: | ||
BASE_IMAGE_NAME: octopuslabs/tentacle | ||
WORKER_IMAGE_NAME: octopuslabs/tentacle-worker | ||
EXECUTION_CONTAINER_IMAGE_NAME: octopuslabs/tentacle-executioncontainer | ||
K8S_IMAGE_NAME: octopuslabs/tentacle-k8sworker | ||
|
||
jobs: | ||
# Push image to GitHub Packages. | ||
# See also https://docs.docker.com/docker-hub/builds/ | ||
push: | ||
name: Build and Push Docker Image | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Build base image | ||
run: docker build ./base --tag $BASE_IMAGE_NAME | ||
|
||
- name: Log into DockerHub | ||
# TODO: Create a PAT with `read:packages` and `write:packages` scopes and save it as an Actions secret `CR_PAT` | ||
run: echo "${{ secrets.CR_PAT }}" | docker login -u devopsatoctopus --password-stdin | ||
|
||
- name: Push base image to DockerHub | ||
run: | | ||
# Strip git ref prefix from version | ||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | ||
# Strip "v" prefix from tag name | ||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | ||
echo VERSION=$VERSION | ||
docker tag $BASE_IMAGE_NAME $BASE_IMAGE_NAME:latest | ||
docker tag $BASE_IMAGE_NAME $BASE_IMAGE_NAME:$VERSION | ||
docker push $BASE_IMAGE_NAME:$VERSION | ||
docker push $BASE_IMAGE_NAME:latest | ||
- name: Build worker image | ||
run: docker build ./tentacle-worker --tag $WORKER_IMAGE_NAME | ||
|
||
- name: Push worker image to DockerHub | ||
run: | | ||
# Strip git ref prefix from version | ||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | ||
# Strip "v" prefix from tag name | ||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | ||
echo VERSION=$VERSION | ||
docker tag $WORKER_IMAGE_NAME $WORKER_IMAGE_NAME:latest | ||
docker tag $WORKER_IMAGE_NAME $WORKER_IMAGE_NAME:$VERSION | ||
docker push $WORKER_IMAGE_NAME:$VERSION | ||
docker push $WORKER_IMAGE_NAME:latest | ||
- name: Build execution container image | ||
run: docker build ./tentacle-executioncontainer --tag $EXECUTION_CONTAINER_IMAGE_NAME | ||
|
||
- name: Push execution container image to DockerHub | ||
run: | | ||
# Strip git ref prefix from version | ||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | ||
# Strip "v" prefix from tag name | ||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | ||
echo VERSION=$VERSION | ||
docker tag $EXECUTION_CONTAINER_IMAGE_NAME $EXECUTION_CONTAINER_IMAGE_NAME:latest | ||
docker tag $EXECUTION_CONTAINER_IMAGE_NAME $EXECUTION_CONTAINER_IMAGE_NAME:$VERSION | ||
docker push $EXECUTION_CONTAINER_IMAGE_NAME:$VERSION | ||
docker push $EXECUTION_CONTAINER_IMAGE_NAME:latest | ||
- name: Build k8s image | ||
run: docker build ./tentacle-executioncontainer --tag $K8S_IMAGE_NAME | ||
|
||
- name: Push k8s image to DockerHub | ||
run: | | ||
# Strip git ref prefix from version | ||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | ||
# Strip "v" prefix from tag name | ||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | ||
echo VERSION=$VERSION | ||
docker tag $K8S_IMAGE_NAME $K8S_IMAGE_NAME:latest | ||
docker tag $K8S_IMAGE_NAME $K8S_IMAGE_NAME:$VERSION | ||
docker push $K8S_IMAGE_NAME:$VERSION | ||
docker push $K8S_IMAGE_NAME:latest | ||
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
FROM mcr.microsoft.com/dotnet/core/runtime-deps:3.1-bionic | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y wget unzip apt-utils curl software-properties-common | ||
|
||
EXPOSE 10933 | ||
|
||
COPY ./scripts/* /scripts/ | ||
RUN chmod +x /scripts/*.sh | ||
|
||
# Install Tentacle | ||
RUN apt-key adv --fetch-keys https://apt.octopus.com/public.key && \ | ||
add-apt-repository "deb https://apt.octopus.com/ stretch main" && \ | ||
apt-get update && \ | ||
apt-get install tentacle | ||
|
||
WORKDIR / | ||
|
||
ENV SERVER_URL="https://octopus.example.com/" | ||
ENV SERVER_PORT=10943 | ||
ENV SERVER_API_KEY="API-SOURCE-THIS-FROM-YOUR-OCTOPUS-SERVER" | ||
ENV ServerThumbprint="" | ||
ENV SERVER_USERNAME="" | ||
ENV SERVER_PASSWORD="" | ||
ENV TARGET_ENVIRONMENT="" | ||
ENV TARGET_ROLE="" | ||
ENV REGISTRATION_NAME="" | ||
ENV SPACE="Default" | ||
ENV TARGET_WORKER_POOL="" | ||
ENV MACHINE_POLICY_NAME="Default Machine Policy" | ||
ENV COMMUNICATION_TYPE="Polling" | ||
ENV DISABLE_DIND=N | ||
ENV ACCEPT_EULA=N | ||
|
||
CMD /scripts/configure-tentacle.sh && /scripts/run-tentacle.sh |
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM octopuslabs/tentacle:latest | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y curl sudo dos2unix && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /tmp | ||
|
||
COPY ./install-scripts/* /install-scripts/ | ||
RUN chmod +x /install-scripts/*.sh | ||
|
||
# Install Docker daemon and CLI | ||
COPY ./scripts/dockerd-entrypoint.sh /usr/local/bin/ | ||
RUN /install-scripts/install-docker.sh | ||
|
||
VOLUME /var/lib/docker |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.