From 7a40fda341c7affce79fc5b2f13c96830852c9db Mon Sep 17 00:00:00 2001 From: Jonas Forsberg Date: Tue, 15 Oct 2024 11:07:22 +0200 Subject: [PATCH] . --- .gitea/workflows/.image-build.yaml.swp | Bin 0 -> 12288 bytes .gitea/workflows/image-build.yaml | 21 +++++++++++++++++ Containerfile | 17 ++++++++++++++ entrypoint.sh | 30 +++++++++++++++++++++++++ 4 files changed, 68 insertions(+) create mode 100644 .gitea/workflows/.image-build.yaml.swp create mode 100644 .gitea/workflows/image-build.yaml create mode 100644 Containerfile create mode 100644 entrypoint.sh diff --git a/.gitea/workflows/.image-build.yaml.swp b/.gitea/workflows/.image-build.yaml.swp new file mode 100644 index 0000000000000000000000000000000000000000..a08c8167eb16b8762ab9bc8ed2fde838e661b644 GIT binary patch literal 12288 zcmeI2&1(}u7>B2V7quVgLGUzMQ3NNOeo_NMYZHppHl;Co64`7f$u^tauru3QO7Q4S zFJAix2%bg3{sW#pNH2^{zRBst&dfDDiUGC&5%02%lT4VYENrcW@o3&Q{Zk0xjMG|bpX@D98IufPs? z37&x`;30SbY_I}~;0*XS#Ml?`8ti~=&;iR}0bBwjU>NKUA|H4P9)k|J1FnK05bo>k zamHSN=U^K=0yZduWiSOUf}`N;F~&ZC_kb=kKnBPF86X2>fDDj<|Iz?YEb*j_TO&AQ6*^|8y`F||}W>5gii!#Qm)u78gDH*DR=MNjb# zuZ1Hb^H6pz%`qfmEdEq(U_Lk9D!+*w*q-TY#l8bR Cd)R*f literal 0 HcmV?d00001 diff --git a/.gitea/workflows/image-build.yaml b/.gitea/workflows/image-build.yaml new file mode 100644 index 0000000..90e9b9c --- /dev/null +++ b/.gitea/workflows/image-build.yaml @@ -0,0 +1,21 @@ +??? from here until ???END lines may have been inserted/deleted +name: Lint and Test Charts + +on: + push: + +jobs: + lint-test: + runs-on: ubuntu-latest +steps: + - uses: actions/checkout@v3 + name: Check out code + + - uses: mr-smithers-excellent/docker-build-push@v6 + name: Build & push Docker image + with: + image: azure-agent + registry: repo.rre.nu + dockerfile: Containerfile + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..6e938c8 --- /dev/null +++ b/Containerfile @@ -0,0 +1,17 @@ +ARG VERSION +FROM registry.opensuse.org/opensuse/tumbleweed + +VOLUME /config + + +RUN zypper --non-interactive install --no-recommends \ + dnsmasq \ + && zypper clean -a \ + rm /var/log/zypper.log + +ENV TZ="Europe/Stockholm" +COPY entrypoint.sh /usr/local/bin/entrypoint.sh +RUN chmod +x /usr/local/bin/entrypoint.sh +ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] +CMD ["start"] + diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..19d54a6 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + + +if [[ "$1" == "start" ]]; then + if [[ ! -f /config/dnsmasq.conf ]]; then + echo "* Creating /config/dnsmasq.conf" + sed 's/^conf-dir=\/etc\//conf-dir=\/config\//g' /etc/dnsmasq.conf > /config/dnsmasq.conf + fi + if [[ ! -f /config/hosts/hosts ]]; then + echo "* Creating /config/hosts/hosts" + mkdir /config/hosts + cp /etc/hosts /config/hosts/hosts + fi + if [[ ! -f /config/resolv.conf ]]; then + echo "* Creating /config/resolv.conf" + cp /etc/resolv.conf /config/resolv.conf + fi + if [[ ! -d /config/dnsmasq.d ]]; then + echo "* Creating /config/dnsmasq.d" + mkdir /config/dnsmasq.d + fi + /usr/sbin/dnsmasq \ + --conf-fil=/config/dnsmasq.conf \ + --no-daemon --no-hosts \ + --keep-in-foreground \ + --resolv-file=/config/resolv.conf \ + --hostsdir=/config/hosts +else + exec "$@" +fi