diff --git a/.gitea/workflows/.image-build.yaml.swp b/.gitea/workflows/.image-build.yaml.swp new file mode 100644 index 0000000..a08c816 Binary files /dev/null and b/.gitea/workflows/.image-build.yaml.swp differ 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