TimothyYe / godns

A dynamic DNS client tool that supports AliDNS, Cloudflare, Google Domains, DNSPod, HE.net & DuckDNS & DreamHost, etc, written in Go.
https://timothyye.github.io/godns/
Apache License 2.0
1.52k stars 224 forks source link

chore: update Dockerfile #223

Closed Aden-Q closed 11 months ago

Aden-Q commented 11 months ago

What does this PR?

Tidy Dockerfile. The WORKDIR directive will create the dir and switch the current working directory to it by default. According to the official docs:

The WORKDIR instruction sets the working directory for any RUN, CMD, ENTRYPOINT, COPY and ADD instructions that follow it in the Dockerfile. If the WORKDIR doesn't exist, it will be created even if it's not used in any subsequent Dockerfile instruction.

Tested with docker build and docker run:

➜  godns git:(dockerfile-tidy) docker run -d --name godns --restart=always -v ./config.json:/config.json docker.io/library/godns
321bd5715676b4efa0d7146f6f89e01606120489aed3fbff0a1aba29bb4c6921