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

Commit 7db4c3a

Browse files
authored
Merge pull request #6 from fullstack-devops/bugfix/kaniko-builder
Bugfix/kaniko builder
2 parents 8d733cd + a3786bc commit 7db4c3a

File tree

7 files changed

+28
-4
lines changed

7 files changed

+28
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.env

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ volumes:
7373

7474
services:
7575
github-action-runner:
76-
image: github-action-runner:base-latest
76+
image: ghcr.io/fullstack-devops/github-actions-runner:base-latest
7777
environment:
7878
GH_ORG: fullstack-devops
7979
GH_ACCESS_TOKEN: ghp_****
@@ -82,7 +82,7 @@ services:
8282
- kaniko_workspace:/kaniko/workspace
8383

8484
github-action-runner-kaniko:
85-
image: github-action-runner:kaniko-sidecar-latest
85+
image: ghcr.io/fullstack-devops/github-actions-runner:kaniko-sidecar-latest
8686
volumes:
8787
- kaniko_workspace:/kaniko/workspace
8888
```

examples/docker-compose/.env-template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export GH_ACCESS_TOKEN=""
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: "3"
2+
3+
volumes:
4+
kaniko_workspace:
5+
driver: local
6+
7+
services:
8+
github-action-runner:
9+
image: ghcr.io/fullstack-devops/github-actions-runner:base-latest
10+
environment:
11+
GH_ORG: fullstack-devops
12+
KANIKO_ENABLED: "true"
13+
GH_ACCESS_TOKEN: ${GH_ACCESS_TOKEN}
14+
volumes:
15+
- kaniko_workspace:/kaniko/workspace
16+
17+
github-action-runner-kaniko:
18+
image: ghcr.io/fullstack-devops/github-actions-runner:kaniko-sidecar-latest
19+
volumes:
20+
- kaniko_workspace:/kaniko/workspace

images/base/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ WORKDIR /home/${USERNAME}/runner
4545
# add a non-sudo user
4646
RUN useradd -m $USERNAME \
4747
&& usermod -aG sudo $USERNAME \
48-
&& chown -R $USERNAME /home/${USERNAME} \
48+
&& chown -R $USERNAME $GH_RUNNER_WORKDIR \
49+
&& chown -R $USERNAME $GH_KANIKO_WORKDIR \
4950
&& mkdir -p ${RUNNER_HOME}
5051

5152
# Install github runner

images/base/helper-scripts/gh-entrypoint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ fi
4343
if [ "$KANIKO_ENABLED" == "true" ]; then
4444
readonly GH_WORKDIR=$GH_KANIKO_WORKDIR
4545
echo "Build container via Kaniko: enabled"
46+
GH_RUNNER_LABELS="${GH_RUNNER_LABELS},kaniko"
4647
else
4748
readonly GH_WORKDIR=$GH_RUNNER_WORKDIR
4849
echo "Build container via Kaniko: disabled"

images/base/helper-scripts/kaniko-wrapper.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if [ -p $returnpipe ]; then
1212
echo "Warning: removed stale communication returncode file with kaniko"
1313
fi
1414
echo "cd ${PWD}" > /kaniko/workspace/start.sh
15-
echo "/kaniko/executor --cleanup $@" >> /kaniko/workspace/start.sh
15+
echo "/kaniko/executor --cleanup --force $@" >> /kaniko/workspace/start.sh
1616
mkfifo $returnpipe
1717
mkfifo $logpipe
1818
cat $logpipe

0 commit comments

Comments
 (0)