Skip to content

Commit

Permalink
Fixed distroless docker container and some warnings and improved readme
Browse files Browse the repository at this point in the history
  • Loading branch information
cromefire committed Jul 26, 2024
1 parent f839240 commit 7e6f890
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 15 deletions.
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21-alpine as server_build
FROM golang:1.22-alpine AS server_build

WORKDIR /appbuild

Expand All @@ -13,11 +13,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/r
# Build deployable server
FROM gcr.io/distroless/static:debug

ENV FRITZBOX_ENDPOINT_URL=${FRITZBOX_ENDPOINT_URL:-http://fritz.box:49000} \
FRITZBOX_ENDPOINT_TIMEOUT=${FRITZBOX_ENDPOINT_TIMEOUT:-30s} \
DYNDNS_SERVER_BIND=${DYNDNS_SERVER_BIND:-:8080} \
DYNDNS_SERVER_USERNAME=${DYNDNS_SERVER_USERNAME} \
DYNDNS_SERVER_PASSWORD=${DYNDNS_SERVER_PASSWORD} \
ENV FRITZBOX_ENDPOINT_URL="http://fritz.box:49000" \
FRITZBOX_ENDPOINT_TIMEOUT="30s" \
DYNDNS_SERVER_BIND=":8080" \
DYNDNS_SERVER_USERNAME="" \
DYNDNS_SERVER_PASSWORD="" \
CLOUDFLARE_API_EMAIL="" \
CLOUDFLARE_API_KEY="" \
CLOUDFLARE_ZONES_IPV4="" \
Expand Down
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,28 @@ process.

## Docker build

_Note: A pre-built docker image is also available on this
GitHub [repository](https://github.com/cromefire/fritzbox-cloudflare-dyndns/pkgs/container/fritzbox-cloudflare-dyndns)._
A pre-built docker image is also available on this
GitHub [repository](https://github.com/cromefire/fritzbox-cloudflare-dyndns/pkgs/container/fritzbox-cloudflare-dyndns)
as `ghcr.io/cromefire/fritzbox-cloudflare-dyndns:<version>`.
The version is something like `1.2` (you can leave out the patch version), please don't use `latest` directly, as it may
break at any point with a major release.

More raw approach would be to build and run it yourself:
You can use it with compose like this:

```yaml
name: "dyndns"
services:
updater:
image: "ghcr.io/cromefire/fritzbox-cloudflare-dyndns:<version>"
env_file: ./updater.env
restart: unless-stopped
ports:
- 8080/tcp
```
With your secret configure in the `updater.env` file next to it (as `SOME_VARIABLE=<valua>`).

The more raw approach would be to build and run it yourself:

```
docker build -t fritzbox-cloudflare-dyndns .
Expand Down
12 changes: 6 additions & 6 deletions alpine.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22-alpine as server_build
FROM golang:1.22-alpine AS server_build

WORKDIR /appbuild

Expand All @@ -13,11 +13,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/r
# Build deployable server
FROM alpine:3

ENV FRITZBOX_ENDPOINT_URL=${FRITZBOX_ENDPOINT_URL:-http://fritz.box:49000} \
FRITZBOX_ENDPOINT_TIMEOUT=${FRITZBOX_ENDPOINT_TIMEOUT:-30s} \
DYNDNS_SERVER_BIND=${DYNDNS_SERVER_BIND:-:8080} \
DYNDNS_SERVER_USERNAME=${DYNDNS_SERVER_USERNAME} \
DYNDNS_SERVER_PASSWORD=${DYNDNS_SERVER_PASSWORD} \
ENV FRITZBOX_ENDPOINT_URL="http://fritz.box:49000" \
FRITZBOX_ENDPOINT_TIMEOUT="30s" \
DYNDNS_SERVER_BIND=":8080" \
DYNDNS_SERVER_USERNAME="" \
DYNDNS_SERVER_PASSWORD="" \
CLOUDFLARE_API_EMAIL="" \
CLOUDFLARE_API_KEY="" \
CLOUDFLARE_ZONES_IPV4="" \
Expand Down

0 comments on commit 7e6f890

Please sign in to comment.