-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e010c1
commit 0d02112
Showing
3 changed files
with
48 additions
and
0 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,37 @@ | ||
name: Build and Push Docker Images | ||
|
||
on: | ||
push: | ||
paths: | ||
- "utilcontainer/**/Dockerfile" | ||
- "utilcontainer/**/*" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
detect-changes: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
utilcontainer: ${{ steps.changed_dirs.outputs.dirs }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v1 | ||
|
||
- name: Get changed directories | ||
id: changed_dirs | ||
run: | | ||
changed_dirs=$(git diff --name-only --diff-filter=d ${{ github.event.before }} ${{ github.sha }} | grep '^utilcontainer/' | awk -F/ '{print $2}' | uniq | sed 's/^/"/;s/$/",/') | ||
changed_dirs=$(echo $changed_dirs | tr -d '\n') | ||
echo "dirs=[ $changed_dirs ]" | ||
echo "dirs=[$changed_dirs]" >> $GITHUB_OUTPUT | ||
build-and-push-utilcontainer: | ||
needs: detect-changes | ||
if: ${{ needs.detect-changes.outputs.utilcontainer != '[]' || contains(github.event_name, 'workflow_dispatch') }} | ||
strategy: | ||
matrix: | ||
image: ${{fromJson(needs.detect-changes.outputs.utilcontainer)}} | ||
uses: ./.github/workflows/reusable-docker-build-push.yml | ||
with: | ||
image: ${{ matrix.image }} | ||
folder: utilcontainer/${{ matrix.image }} | ||
|
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,8 @@ | ||
FROM wbitt/network-multitool:e21fa4b | ||
|
||
USER root | ||
|
||
RUN setcap cap_chown,cap_fowner,cap_dac_read_search,cap_dac_override,cap_fsetid,cap_setuid,cap_setgid+ep /bin/chown | ||
RUN setcap cap_chown,cap_fowner,cap_dac_read_search,cap_dac_override,cap_fsetid,cap_setuid,cap_setgid+ep /bin/chmod | ||
|
||
# docker run --user 1000:100 --cap-add=CHOWN --cap-add=FOWNER --cap-add=cap_dac_override --cap-add=cap_dac_read_search --rm -it mymultitool:latest sh |
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,3 @@ | ||
# Multitool | ||
A container with added capabilities for some selected binaries to be used in init container. | ||
Extented from wbitt/network-multitool former pragma/network-multitool |