-
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.
Merge pull request #4 from FreifunkMD/simplify
Simplify the Container build
- Loading branch information
Showing
9 changed files
with
148 additions
and
57 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,51 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
branches: | ||
- 'main' | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: ffmd/bind9-ffmd | ||
tags: | | ||
# 123 | ||
type=match,pattern=v(.*),group=1 | ||
# generate lates from default branch | ||
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
platforms: linux/amd64 | ||
push: ${{ github.event_name != 'pull_request' }} | ||
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,33 @@ | ||
name: Create Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
build: | ||
name: "Release" | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- name: "Check-out" | ||
uses: actions/checkout@v3 | ||
- name: "Generate release changelog" | ||
id: generate-release-changelog | ||
uses: heinrichreimer/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
onlyLastTag: "true" # set to false if no tags exist (buggy with only one tag) | ||
stripHeaders: "true" | ||
stripGeneratorNotice: "true" | ||
- name: Extract the VERSION name | ||
id: get-version | ||
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} | ||
- name: "Create GitHub release" | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: ${{ github.ref }} | ||
name: "${{ steps.get-version.outputs.VERSION }}" | ||
body: "${{ steps.generate-release-changelog.outputs.changelog }}" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
draft: True |
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 |
---|---|---|
@@ -1,34 +1,8 @@ | ||
FROM debian:buster AS install | ||
|
||
ARG GITREPO | ||
ARG GITREF=master | ||
|
||
# Apt-proxy config | ||
COPY apt-proxy-detect.sh /usr/local/lib/ | ||
COPY 01proxy /etc/apt/apt.conf.d | ||
|
||
# Keep apt cache directories! | ||
RUN apt-get update \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||
git | ||
|
||
RUN git clone $GITREPO /tmp/bind | ||
RUN cd /tmp/bind && git checkout $GITREF | ||
|
||
# Download bind9 for the next stage | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||
--download-only \ | ||
bind9 | ||
|
||
|
||
FROM debian:buster | ||
|
||
LABEL maintainer="[email protected]" | ||
|
||
COPY --from=install /var/lib/apt/lists/ /var/lib/apt/lists/ | ||
COPY --from=install /var/cache/apt/ /var/cache/apt/ | ||
|
||
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \ | ||
bind9 \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& rm -rf /var/cache/apt/* | ||
|
@@ -37,4 +11,7 @@ COPY --from=install /tmp/bind /etc/bind | |
|
||
EXPOSE 53/udp 53/tcp | ||
|
||
COPY named.conf.local /etc/bind | ||
COPY ffmd.zone /etc/bind | ||
|
||
CMD ["/usr/sbin/named", "-f", "-g"] |
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 |
---|---|---|
@@ -1,11 +1,24 @@ | ||
# Docker image for git-configured bind9 | ||
# ffmd Bind9 Image | ||
|
||
Arguments: | ||
* GITREPO: Git reporistory URI | ||
* GITREF: Branch or tag in GITREPO, defaults to `master` | ||
> Bind9 container image with configuration for the ffmd zone | ||
Build with as | ||
``` | ||
docker build --build-arg GITREPO=<git uri> --build-arg GITREF=<branch or tag> | ||
## Releases | ||
|
||
Releases are created automatically based on the version. | ||
|
||
**Version tags** follow the serial numbers, e.g. `v2022060801`. | ||
The serial number will be the tag for the docker image. | ||
|
||
## Deploy | ||
|
||
### with Docker | ||
|
||
```bash | ||
docker run --rm -it -p 127.0.0.1:53:53/udp ffmd/bind9-ffmd:latest | ||
``` | ||
|
||
### Production | ||
|
||
The production image is deployed using [Ansible](https://github.com/FreifunkMD/backend-ffmd) via [backend-ffmd](https://github.com/FreifunkMD/backend-ffmd). | ||
|
||
|
This file was deleted.
Oops, something went wrong.
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,28 @@ | ||
$ORIGIN ffmd. | ||
$TTL 86400 | ||
@ SOA ns1.ffmdnic.ffmd. abuse.md.freifunk.net. ( | ||
2019110102 ; serial | ||
21600 ; refresh after 6 hours | ||
3600 ; retry after 1 hour | ||
604800 ; expire after 1 week | ||
86400 ) ; minimum TTL of 1 day | ||
NS ns1.ffmdnic.ffmd. | ||
; | ||
ns1.ffmdnic A 10.139.0.53 | ||
AAAA fda9:26e:5805::9 | ||
AAAA fda9:26e:5805::2 | ||
; | ||
nextnode A 10.139.0.1 | ||
AAAA fda9:026e:5805::1 | ||
; | ||
1.ntp AAAA fda9:26e:5805::9 | ||
2.ntp AAAA fda9:26e:5805::2 | ||
; | ||
stable.updates.firmware AAAA fda9:26e:5805::9 | ||
beta.updates.firmware AAAA fda9:26e:5805::9 | ||
experimental.updates.firmware AAAA fda9:26e:5805::9 | ||
; | ||
stable-babel.updates.firmware AAAA fda9:26e:5805::9 | ||
experimental-babel.updates.firmware AAAA fda9:26e:5805::9 | ||
test-babel.updates.firmware AAAA fda9:26e:5805::9 | ||
; |
This file was deleted.
Oops, something went wrong.
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,12 @@ | ||
// | ||
// Do any local configuration here | ||
// | ||
|
||
// Consider adding the 1918 zones here, if they are not used in your | ||
// organization | ||
//include "/etc/bind/zones.rfc1918"; | ||
|
||
zone "ffmd" IN { | ||
type master; | ||
file "/etc/bind/ffmd.zone"; | ||
}; |