-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e2b35c
commit c7b563e
Showing
16 changed files
with
190 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Compiled Object files, Static and Dynamic libs (Shared Objects) | ||
*.o | ||
*.a | ||
*.so | ||
|
||
.vscode/ | ||
.github/ | ||
release/ | ||
build/ | ||
vendor/ | ||
|
||
Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,29 @@ | ||
FROM golang:alpine as builder | ||
ENV CGO_ENABLED=0 \ | ||
GO111MODULE=on | ||
|
||
RUN apk add --update git curl | ||
ADD . $GOPATH/src/github.com/honwen/aliyun-ddns-cli | ||
FROM golang as builder | ||
WORKDIR /builder | ||
ADD . . | ||
RUN set -ex \ | ||
&& cd $GOPATH/src/github.com/honwen/aliyun-ddns-cli \ | ||
&& go build -ldflags "-X main.VersionString=$(curl -sSL https://api.github.com/repos/honwen/aliyun-ddns-cli/commits/master | \ | ||
sed -n '{/sha/p; /date/p;}' | sed 's/.* \"//g' | cut -c1-10 | tr '[:lower:]' '[:upper:]' | sed 'N;s/\n/@/g' | head -1)" . \ | ||
&& mv aliyun-ddns-cli $GOPATH/bin/ | ||
&& curl -sSL https://api.github.com/repos/honwen/aliyun-ddns-cli/commits/master | sed -n '{/sha/p; /date/p;}' | sed 's/.* \"//g' | cut -c1-10 | tr '[:lower:]' '[:upper:]' | sed 'N;s/\n/@/g' | head -n1 | tee .version \ | ||
&& go mod vendor \ | ||
&& GOOS=linux GOARCH=amd64 VERSION=$(cat .version) make release | ||
|
||
|
||
FROM alpine | ||
LABEL MAINTAINER honwen <https://github.com/honwen> | ||
|
||
# /usr/bin/aliyun-ddns-cli | ||
COPY --from=builder /go/bin /usr/bin | ||
COPY --from=builder /builder/build/linux-amd64/aliddns /usr/bin/aliyun-ddns-cli | ||
|
||
ENV AKID=1234567890 \ | ||
AKSCT=abcdefghijklmn \ | ||
DOMAIN=ddns.example.win \ | ||
IPAPI=[IPAPI-GROUP] \ | ||
REDO=0 | ||
REDO=555r \ | ||
TTL=600 | ||
|
||
CMD aliyun-ddns-cli \ | ||
--ipapi ${IPAPI} \ | ||
${IPV6:+-6} \ | ||
auto-update \ | ||
--domain ${DOMAIN} \ | ||
--redo ${REDO} | ||
--redo ${REDO} \ | ||
--ttl ${TTL} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.