Merge ~barryprice/charm-k8s-bind/+git/charm-k8s-bind:wrapper into charm-k8s-bind:master

Proposed by Barry Price
Status: Merged
Approved by: Barry Price
Approved revision: 87fa1ab2ed824166e63b03caa8c53677e144fd15
Merged at revision: 04821b38c11acb7a7f452ae3eeaa1ddb3e2406c9
Proposed branch: ~barryprice/charm-k8s-bind/+git/charm-k8s-bind:wrapper
Merge into: charm-k8s-bind:master
Diff against target: 50 lines (+7/-6)
3 files modified
Makefile (+1/-1)
dockerfile (+4/-5)
image-scripts/docker-wrapper.sh (+2/-0)
Reviewer Review Type Date Requested Status
Tom Haddon Approve
Barry Price Pending
Review via email: mp+402966@code.launchpad.net

Commit message

Convert from using both ENTRYPOINT and CMD to a single wrapper script that sets up our config and then starts the bind service

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Tom Haddon (mthaddon) wrote :

LGTM

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 04821b38c11acb7a7f452ae3eeaa1ddb3e2406c9

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/Makefile b/Makefile
2index 35b100d..564aeb9 100644
3--- a/Makefile
4+++ b/Makefile
5@@ -30,7 +30,7 @@ image-deps:
6
7 image-lint: image-deps
8 @echo "Running shellcheck."
9- @shellcheck image-scripts/docker-entrypoint.sh
10+ @shellcheck image-scripts/docker-wrapper.sh
11 @shellcheck image-scripts/dns-check.sh
12
13 image-build: image-lint
14diff --git a/dockerfile b/dockerfile
15index 968d4fd..94856fb 100644
16--- a/dockerfile
17+++ b/dockerfile
18@@ -19,15 +19,14 @@ RUN apt-get update && apt-get -y dist-upgrade \
19 && apt-get --purge autoremove -y \
20 && apt-get install -y bind9 dnsutils git ${EXTRA_PKGS_TO_INSTALL}
21
22-# entrypoint script will configure Bind based on env variables
23+# wrapper script will configure Bind based on env variables and run it
24 # dns-check script will provide a readinessProbe
25-COPY ./image-scripts/docker-entrypoint.sh /usr/local/bin/
26+COPY ./image-scripts/docker-wrapper.sh /usr/local/bin/
27 COPY ./image-scripts/dns-check.sh /usr/local/bin/
28-RUN chmod 0755 /usr/local/bin/docker-entrypoint.sh
29+RUN chmod 0755 /usr/local/bin/docker-wrapper.sh
30 RUN chmod 0755 /usr/local/bin/dns-check.sh
31
32 EXPOSE 53/udp
33 EXPOSE 53/tcp
34
35-ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
36-CMD /usr/sbin/named -g -u bind -c /etc/bind/named.conf
37+CMD ["/usr/local/bin/docker-wrapper.sh"]
38diff --git a/image-scripts/docker-entrypoint.sh b/image-scripts/docker-wrapper.sh
39similarity index 97%
40rename from image-scripts/docker-entrypoint.sh
41rename to image-scripts/docker-wrapper.sh
42index 2ed0857..4f807e1 100644
43--- a/image-scripts/docker-entrypoint.sh
44+++ b/image-scripts/docker-wrapper.sh
45@@ -21,3 +21,5 @@ if [ -d "${BIND_CONFDIR}" ]; then
46 else
47 echo "Something went wrong, ${BIND_CONFDIR} does not exist, not starting";
48 fi
49+
50+/usr/sbin/named -g -u bind -c /etc/bind/named.conf

Subscribers

People subscribed via source and target branches

to all changes: