Skip to content

Commit 6614237

Browse files
committed
test docker image build
1 parent 2edc3cd commit 6614237

File tree

4 files changed

+960
-0
lines changed

4 files changed

+960
-0
lines changed

.github/workflows/build-image.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Build docker Image
2+
3+
env:
4+
PLATFORMS: linux/386,linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le
5+
6+
on:
7+
workflow_dispatch:
8+
push:
9+
branches:
10+
- main
11+
paths:
12+
- "docker-image/**"
13+
14+
jobs:
15+
generate_tag:
16+
runs-on: ubuntu-latest
17+
outputs:
18+
output: ${{ steps.tag.outputs.tag }}
19+
steps:
20+
- name: Check out the repo
21+
uses: actions/checkout@v2
22+
with:
23+
ref: main
24+
fetch-depth: 0
25+
- id: tag
26+
shell: bash
27+
run: |
28+
echo "Tag: $(git describe --abbrev=0)"
29+
echo "::set-output name=tag::$(git describe --abbrev=0)"
30+
31+
build-image:
32+
runs-on: ubuntu-latest
33+
needs: generate_tag
34+
steps:
35+
- name: Check out the repo
36+
uses: actions/checkout@v2
37+
38+
- name: Login to GitHub Container Registry
39+
uses: docker/login-action@v1
40+
with:
41+
registry: ghcr.io
42+
username: ${{ github.repository_owner }}
43+
password: ${{ secrets.GITHUB_TOKEN }}
44+
45+
- name: Set up QEMU
46+
uses: docker/setup-qemu-action@v1
47+
with:
48+
platforms: $PLATFORMS
49+
- name: Set up Docker Buildx
50+
id: buildx
51+
uses: docker/setup-buildx-action@v1
52+
53+
- name: Build and push image
54+
uses: docker/build-push-action@v2
55+
with:
56+
builder: ${{ steps.buildx.outputs.name }}
57+
context: ./docker-image/
58+
platforms: $PLATFORMS
59+
push: true
60+
tags: |
61+
ghcr.io/${GITHUB_REPOSITORY}:latest
62+
ghcr.io/${GITHUB_REPOSITORY}:${{needs.generate_tag.outputs.output}}

.gitignore

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Note:
2+
# To effectively apply the changes you will have
3+
# to re-index the git index (if there are already
4+
# commited files)
5+
#
6+
# $ git rm -r --cached .
7+
# $ git add .
8+
# $ git commit -m ".gitignore index rebuild"
9+
#
10+
11+
12+
######################################
13+
# CUSTOM
14+
######################################
15+
16+
17+
######################################
18+
# GENERIC
19+
######################################
20+
21+
###### std ######
22+
.lock
23+
*.log
24+
25+
###### patches/diffs ######
26+
*.patch
27+
*.diff
28+
*.orig
29+
*.rej
30+
31+
32+
######################################
33+
# Operating Systems
34+
######################################
35+
36+
###### OSX ######
37+
._*
38+
.DS*
39+
.Spotlight-V100
40+
.Trashes
41+
42+
###### Windows ######
43+
Thumbs.db
44+
ehthumbs.db
45+
Desktop.ini
46+
$RECYCLE.BIN/
47+
*.lnk
48+
*.shortcut
49+
50+
######################################
51+
# Editors
52+
######################################
53+
54+
###### Sublime ######
55+
*.sublime-workspace
56+
*.sublime-project
57+
58+
###### Eclipse ######
59+
.classpath
60+
.buildpath
61+
.project
62+
.settings/
63+
64+
###### Netbeans ######
65+
/nbproject/
66+
67+
###### Intellij IDE ######
68+
.idea/
69+
.idea_modules/
70+
71+
###### vim ######
72+
*.swp
73+
*.swo
74+
*.swn
75+
*.swm
76+
*~
77+
78+
###### TextMate ######
79+
.tm_properties
80+
*.tmproj
81+
82+
###### BBEdit ######
83+
*.bbprojectd
84+
*.bbproject
85+
86+
.vagrant

docker-image/Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM debian:buster-slim
2+
3+
ENV DEBIAN_FRONTEND noninteractive
4+
ENV LC_ALL C.UTF-8
5+
6+
ARG BIND_VERSION=9.16.24
7+
8+
###
9+
### Install
10+
###
11+
RUN set -x \
12+
&& apt-get -qqqy update \
13+
&& apt-get -qqqy install --no-install-recommends --no-install-suggests -y \
14+
bind9=$BIND_VERSION \
15+
dnsutils \
16+
iputils-ping \
17+
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps \
18+
&& rm -r /var/lib/apt/lists/* \
19+
&& mkdir /var/log/named \
20+
&& chown bind:bind /var/log/named \
21+
&& chmod 0755 /var/log/named
22+
23+
###
24+
### Bootstrap Scipts
25+
###
26+
COPY ./docker-entrypoint.sh /
27+
28+
###
29+
### Ports
30+
###
31+
EXPOSE 53/udp 53/tcp 953/tcp
32+
33+
####
34+
#### Entrypoint
35+
####
36+
ENTRYPOINT ["/docker-entrypoint.sh"]

0 commit comments

Comments
 (0)