Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated docker file #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
FROM alpine:edge
FROM alpine:latest

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this change will switch from edge to the latest supported Alpine release (currently 3.12). It would be wiser to be more explicit and just state 3.12 here and update accordingly in the future when newer releases of Alpine or dnsmasq are made available.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, should be explicit version


LABEL maintainer="[email protected]"
# webproc release settings
ENV WEBPROC_VERSION 0.2.2
ENV WEBPROC_URL https://github.com/jpillora/webproc/releases/download/$WEBPROC_VERSION/webproc_linux_amd64.gz

# expose ports
EXPOSE 53
EXPOSE 8080

# fetch dnsmasq and webproc binary
RUN apk update \
&& apk --no-cache add dnsmasq \
&& apk add --no-cache --virtual .build-deps curl \
&& curl -sL $WEBPROC_URL | gzip -d - > /usr/local/bin/webproc \
&& chmod +x /usr/local/bin/webproc \
&& apk del .build-deps
RUN apk update && \
apk --no-cache add dnsmasq bash && \
apk add --no-cache --virtual .build-deps curl && \
curl -sL https://i.jpillora.com/webproc | bash && \
apk del .build-deps && \
mv webproc /usr/local/bin/ && \
\
mkdir -p /etc/default/ && \
echo -e "ENABLED=1\nIGNORE_RESOLVCONF=yes" > /etc/default/dnsmasq

#configure dnsmasq
RUN mkdir -p /etc/default/
RUN echo -e "ENABLED=1\nIGNORE_RESOLVCONF=yes" > /etc/default/dnsmasq
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we not need this file anymore?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

@polarathene polarathene Aug 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jpillora this is in response to your review comments from earlier, github UI may not make that obvious.


They moved these two RUN lines into the first RUN to keep them all in the same layer.

They droped the two ENV declarations at the start of the file to call some shell script file you're hosting at https://i.jpillora.com/webproc, piping that through bash to retrieve the latest version of webproc that way. While nice, it will remove immutability of the build as the version is no longer pinned.

That script does some of the logic here, unarchiving the file and outputting a binary with execution rights enabled via chmod +x, it just needs to move the binary.

The ENTRYPOINT change is just whitespace formatting and renaming the --config option to match the newer option name you must have modified while developing webproc.

Addition of EXPOSE only serves value of communicating what ports the user should map to the image, it doesn't really do any thing beyond that.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, they just moved it 👍

Agreed, probably safer to keep existing logic and use the direct github URL.

COPY dnsmasq.conf /etc/dnsmasq.conf

#run!
ENTRYPOINT ["webproc","--config","/etc/dnsmasq.conf","--","dnsmasq","--no-daemon"]
ENTRYPOINT [ "webproc", "--configuration-file", "/etc/dnsmasq.conf", "--", "dnsmasq", "--no-daemon" ]