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

Commit 5933c55

Browse files
authored
Merge pull request #7 from fullstack-devops/feature/fullstacked-container
add fullstacked image + docs
2 parents 7db4c3a + dfe3b41 commit 5933c55

File tree

7 files changed

+108
-17
lines changed

7 files changed

+108
-17
lines changed

.github/FUNDING.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: [eksrha] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/workflows/build-pr.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ jobs:
4949
5050
- name: link child image to current pr
5151
run: |
52-
sed -i --expression "s@FROM.*@FROM ${{ env.IMAGE_BASE }}:base-pr-${{ github.event.pull_request.number }}@g" images/ansible-k8s/Dockerfile
52+
sed -i --expression "s@FROM.*@FROM ${{ env.IMAGE_BASE }}:base-pr-${{ github.event.pull_request.number }}@g" \
53+
images/ansible-k8s/Dockerfile \
54+
images/fullstacked/Dockerfile
5355
5456
- name: Build github-actions-runner:ansible-k8s
5557
uses: docker/build-push-action@v2
@@ -58,3 +60,11 @@ jobs:
5860
push: true
5961
tags: |
6062
${{ env.IMAGE_BASE }}:ansible-k8s-pr-${{ github.event.pull_request.number }}
63+
64+
- name: Build github-actions-runner:fullstacked
65+
uses: docker/build-push-action@v2
66+
with:
67+
context: ./images/fullstacked
68+
push: true
69+
tags: |
70+
${{ env.IMAGE_BASE }}:fullstacked-pr-${{ github.event.pull_request.number }}

.github/workflows/cleanup-pr.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,34 @@ jobs:
99
name: Delete image from ghcr.io
1010
runs-on: ubuntu-latest
1111
steps:
12-
- name: Delete base image
12+
- name: Delete github-actions-runner:base
1313
uses: bots-house/[email protected]
1414
with:
1515
owner: ${{ github.repository_owner }}
1616
name: github-actions-runner
17-
token: ${{ secrets.GITHUB_TOKEN }}
17+
token: ${{ secrets.GH_DEL_IMAGE_PAT }}
1818
tag: base-pr-${{ github.event.pull_request.number }}
19-
- name: Delete kaniko-sidecar image
19+
20+
- name: Delete github-actions-runner:kaniko-sidecar
2021
uses: bots-house/[email protected]
2122
with:
2223
owner: ${{ github.repository_owner }}
2324
name: github-actions-runner
24-
token: ${{ secrets.GITHUB_TOKEN }}
25+
token: ${{ secrets.GH_DEL_IMAGE_PAT }}
2526
tag: kaniko-sidecar-pr-${{ github.event.pull_request.number }}
26-
- name: Delete kaniko-sidecar image
27+
28+
- name: Delete github-actions-runner:ansible-k8s
29+
uses: bots-house/[email protected]
30+
with:
31+
owner: ${{ github.repository_owner }}
32+
name: github-actions-runner
33+
token: ${{ secrets.GH_DEL_IMAGE_PAT }}
34+
tag: ansible-k8s-pr-${{ github.event.pull_request.number }}
35+
36+
- name: Delete github-actions-runner:fullstacked
2737
uses: bots-house/[email protected]
2838
with:
2939
owner: ${{ github.repository_owner }}
3040
name: github-actions-runner
31-
token: ${{ secrets.GITHUB_TOKEN }}
32-
tag: ansible-k8s-pr-${{ github.event.pull_request.number }}
41+
token: ${{ secrets.GH_DEL_IMAGE_PAT }}
42+
tag: fullstacked-pr-${{ github.event.pull_request.number }}

.github/workflows/create-release.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ jobs:
5858
5959
- name: link child image to current version
6060
run: |
61-
sed -i --expression "s@FROM.*@FROM ${{ env.IMAGE_BASE }}:base-${{ needs.create_release.outputs.version }}@g" images/ansible-k8s/Dockerfile
61+
sed -i --expression "s@FROM.*@FROM ${{ env.IMAGE_BASE }}:base-${{ needs.create_release.outputs.version }}@g" \
62+
images/ansible-k8s/Dockerfile \
63+
images/fullstacked/Dockerfile
6264
6365
- name: Build github-actions-runner:ansible-k8s
6466
uses: docker/build-push-action@v2
@@ -69,6 +71,15 @@ jobs:
6971
${{ env.IMAGE_BASE }}:ansible-k8s-latest
7072
${{ env.IMAGE_BASE }}:ansible-k8s-${{needs.create_release.outputs.version}}
7173
74+
- name: Build github-actions-runner:fullstacked
75+
uses: docker/build-push-action@v2
76+
with:
77+
context: ./images/fullstacked
78+
push: true
79+
tags: |
80+
${{ env.IMAGE_BASE }}:fullstacked-latest
81+
${{ env.IMAGE_BASE }}:fullstacked-${{needs.create_release.outputs.version}}
82+
7283
publish_release:
7384
runs-on: ubuntu-latest
7485
needs: [create_release, build]

README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
# github-runner-base
2-
Base Image for github runner images in repo @fullstack-devops/github-runner. Can also be used as standalone image.
2+
Container images with Github Actions Runner. Different flavored images with preinstalled tools and software for builds with limited internet access and non root privileges.
3+
4+
Ideal for building software in enterprise environments of large organizations that often restrict internet access.
5+
Software builds can be built there using a [Nexus Repository](https://de.sonatype.com/products/repository-oss) or [JFrog Artifactory](https://jfrog.com/de/artifactory/)
6+
7+
Support: If you need help or a feature just open an issue!
38

49
Available Containers:
5-
| Name | Description |
6-
|------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
7-
| `ghcr.io/fullstack-devops/github-actions-runner:base-latest` | Base runner with nothing fancy installed |
8-
| `ghcr.io/fullstack-devops/github-actions-runner:kaniko-sidecar-latest` | Sidecar used by Runner to build containers without root privileges |
9-
| `ghcr.io/fullstack-devops/github-actions-runner:ansible-k8s-latest` | Rrunner with ansible, kubectl and helm installed <br> For more Details see [Dockerfile](images/ansible-k8s/Dockerfile) |
10+
| Name (tag) | Installed Tools/ Software | Description |
11+
|-------------------------|-----------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|
12+
| `base-latest` | libffi-dev, libicu-dev, build-essential, libssl-dev, ca-certificates, jq, sed, grep, git, curl, wget, zip | Base runner with nothing fancy installed <br> [Dockerfile](images/base/Dockerfile) |
13+
| `kaniko-sidecar-latest` | kaniko | Sidecar used by other runner images to build containers without root privileges |
14+
| `ansible-k8s-latest` | base-image + ansible, helm, kubectl | Runner specialized for automated k8s deployments via ansible <br> For more Details see [Dockerfile](images/ansible-k8s/Dockerfile) |
15+
| `fullstacked-latest` | base-image + maven, openjdk-11, nodejs, go, yarn, angular/cli, helm | Runner with a bunch of tools to build your hole application<br> For more Details see [Dockerfile](images/fullstacked/Dockerfile) |
16+
17+
> Hint: `latest can be replaced with an spezfic release version for more stability`
1018
1119
---
1220

images/base/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ RUN useradd -m $USERNAME \
5252
# Install github runner
5353
RUN export ARCH=$(/helper-scripts/translate-aarch.sh x-short) \
5454
&& curl -L -O https://github.com/actions/runner/releases/download/v${GH_RUNNER_VERSION}/actions-runner-linux-${ARCH}-${GH_RUNNER_VERSION}.tar.gz \
55-
&& tar -zxf actions-runner-linux-x64-${GH_RUNNER_VERSION}.tar.gz \
56-
&& rm -f actions-runner-linux-x64-${GH_RUNNER_VERSION}.tar.gz \
55+
&& tar -zxf actions-runner-linux-${ARCH}-${GH_RUNNER_VERSION}.tar.gz \
56+
&& rm -f actions-runner-linux-${ARCH}-${GH_RUNNER_VERSION}.tar.gz \
5757
&& ./bin/installdependencies.sh \
5858
&& cd ./bin \
5959
&& apt-get clean

images/fullstacked/Dockerfile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
FROM ghcr.io/fullstack-devops/github-actions-runner:base-latest
2+
3+
USER root
4+
# install packages along with jq so we can parse JSON
5+
# add additional packages as necessary
6+
ARG PACKAGES="openjdk-11-jdk maven nodejs"
7+
8+
RUN apt-get update \
9+
&& curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \
10+
&& apt-get install -y --no-install-recommends ${PACKAGES} \
11+
&& rm -rf /var/lib/apt/lists/* \
12+
&& apt-get clean
13+
14+
ENV GH_RUNNER_LABELS="ubuntu-20.04,maven,openjdk-11,nodejs,go,yarn,helm"
15+
ARG HELM_VERSION=3.6.3
16+
ARG GO_VERSION=1.17.3
17+
18+
# Install helm
19+
RUN export ARCH=$(/helper-scripts/translate-aarch.sh a-short) \
20+
&& wget -q https://get.helm.sh/helm-v${HELM_VERSION}-linux-${ARCH}.tar.gz -O - | tar -xzO linux-${ARCH}/helm > /usr/local/bin/helm \
21+
&& chmod +x /usr/local/bin/helm
22+
23+
# install build tools for golang
24+
RUN export ARCH=$(/helper-scripts/translate-aarch.sh a-short) \
25+
&& wget https://golang.org/dl/go${GO_VERSION}.linux-${ARCH}.tar.gz -O /usr/local/src/go.linux.tar.gz \
26+
&& tar -xf /usr/local/src/go.linux.tar.gz \
27+
&& rm -rf /usr/local/src/go.linux.tar.gz \
28+
&& ln -s /usr/local/src/go/bin/go /usr/local/bin/
29+
30+
# install npm tools: yarn
31+
RUN npm install --global yarn @angular/cli@13
32+
33+
RUN mkdir -p /home/${USERNAME}/.m2/ \
34+
&& chown -R ${USERNAME} /home/${USERNAME}
35+
USER ${USERNAME}
36+
37+
# install helm plugins helm push, appr && diff
38+
RUN helm plugin install --version 0.10.2 https://github.com/chartmuseum/helm-push.git \
39+
&& helm plugin install --version 0.7.0 https://github.com/app-registry/appr-helm-plugin.git \
40+
&& helm plugin install --version 3.4.2 https://github.com/databus23/helm-diff

0 commit comments

Comments
 (0)