-
Notifications
You must be signed in to change notification settings - Fork 1
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
9129d50
commit 8ef7ad3
Showing
2 changed files
with
72 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 |
---|---|---|
|
@@ -112,3 +112,41 @@ jobs: | |
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
build-gentoo: | ||
name: Gentoo Docker Image | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
packages: read | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
# super-linter needs the full git history to get the | ||
# list of files that changed across commits | ||
fetch-depth: 0 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_ACCESS_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/[email protected] | ||
with: | ||
images: dotfiles | ||
tags: gentoo | ||
|
||
- name: Build and push Docker image | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
file: ./Dockerfile.gentoo | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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,34 @@ | ||
FROM gentoo/stage3:amd64-openrc | ||
|
||
# This is a very up-to-date image, so we aren't going to lock package versions. | ||
# hadolint ignore=DL3041 | ||
RUN emerge --verbose --noreplace \ | ||
net-misc/curl \ | ||
dev-vcs/git \ | ||
app-admin/sudo \ | ||
sys-apps/coreutils && \ | ||
emerge --verbose --depclean | ||
|
||
RUN useradd -m max && \ | ||
echo "max ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers | ||
USER max | ||
ENV USER=max | ||
|
||
# NOTE: This is dangerous because it will include decrypted secrets in the image! | ||
#RUN mkdir -p /home/max/src/miscellaneous | ||
#COPY --chown=max . /home/max/src/miscellaneous/ | ||
|
||
RUN mkdir -p /home/max/src && \ | ||
git clone https://github.com/Maxattax97/miscellaneous.git /home/max/src/miscellaneous | ||
|
||
# Overwrite the install script with the latest one in the repository. | ||
COPY --chown=max install.sh /home/max/src/miscellaneous/install.sh | ||
|
||
WORKDIR /home/max/src/miscellaneous | ||
RUN /bin/sh -o pipefail -c "yes | \ | ||
AUTOMATED=1 /home/max/src/miscellaneous/install.sh && \ | ||
emerge --verbose --depclean" | ||
|
||
WORKDIR /home/max | ||
ENTRYPOINT ["/bin/zsh"] | ||
HEALTHCHECK NONE |