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

Bump to webproc 0.4.0 and dnsmasq 2.89, and support arm64 #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
41 changes: 26 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
FROM alpine:edge
LABEL maintainer="[email protected]"
FROM --platform=$BUILDPLATFORM alpine:latest AS build
# arguments
ARG TARGETOS TARGETARCH
# 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
# fetch dnsmasq and webproc binary
ENV WEBPROC_VERSION 0.4.0
ENV WEBPROC_URL https://github.com/jpillora/webproc/releases/download/v${WEBPROC_VERSION}/webproc_${WEBPROC_VERSION}_${TARGETOS}_${TARGETARCH}.gz
# fetch webproc binary
RUN apk --no-cache --virtual .build-deps add curl \
&& curl -sL $WEBPROC_URL | gzip -d - > /usr/local/bin/webproc \
&& apk del .build-deps

FROM alpine:latest
LABEL maintainer="[email protected]"
ENV HTTP_USER admin
ENV HTTP_PASS password
# fetch dnsmasq 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
#configure dnsmasq
RUN mkdir -p /etc/default/
RUN echo -e "ENABLED=1\nIGNORE_RESOLVCONF=yes" > /etc/default/dnsmasq
&& apk --no-cache add dnsmasq
# copy webproc binary
COPY --from=build /usr/local/bin/webproc /usr/local/bin/webproc
RUN chmod +x /usr/local/bin/webproc
# configure dnsmasq
RUN mkdir -p /etc/default/ \
&& echo -e "ENABLED=1\nIGNORE_RESOLVCONF=yes" > /etc/default/dnsmasq
COPY dnsmasq.conf /etc/dnsmasq.conf
#run!
ENTRYPOINT ["webproc","--config","/etc/dnsmasq.conf","--","dnsmasq","--no-daemon"]
# run!
EXPOSE 53/udp
EXPOSE 8080
ENTRYPOINT ["webproc","--configuration-file","/etc/dnsmasq.conf","--","dnsmasq","--no-daemon"]
27 changes: 17 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,25 @@
dnsmasq in a docker container, configurable via a [simple web UI](https://github.com/jpillora/webproc)

[![Docker Pulls](https://img.shields.io/docker/pulls/jpillora/dnsmasq.svg)][dockerhub]
[![Image Size](https://images.microbadger.com/badges/image/jpillora/dnsmasq.svg)][dockerhub]
[![Image Size (latest)](https://img.shields.io/docker/image-size/jpillora/dnsmasq/latest)][dockerhub]

### Usage
## Usage

1. Create a [`/opt/dnsmasq.conf`](http://oss.segetech.com/intra/srv/dnsmasq.conf) file on the Docker host

```ini
#dnsmasq config, for a complete example, see:
# http://oss.segetech.com/intra/srv/dnsmasq.conf
#log all dns queries
# dnsmasq config, for a complete example, see: http://oss.segetech.com/intra/srv/dnsmasq.conf
# log all dns queries
log-queries
#dont use hosts nameservers
# dont use hosts nameservers
no-resolv
#use cloudflare as default nameservers, prefer 1^4
# use cloudflare as default nameservers, prefer 1^4
server=1.0.0.1
server=1.1.1.1
strict-order
#serve all .company queries using a specific nameserver
# serve all .company queries using a specific nameserver
server=/company/10.0.0.1
#explicitly define host-ip mappings
# explicitly define host-ip mappings
address=/myhost.company/10.0.0.2
```

Expand Down Expand Up @@ -58,7 +57,15 @@ dnsmasq in a docker container, configurable via a [simple web UI](https://github
myhost.company has address 10.0.0.2
```

#### MIT License
## How to build the image.

Follow the guide - https://docs.docker.com/build/building/multi-platform/ or execut the command:

```
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t <username>/<image>:latest --push .
```

## MIT License

Copyright &copy; 2018 Jaime Pillora &lt;[email protected]&gt;

Expand Down