Skip to content

Commit

Permalink
refine Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
honwen committed Jul 15, 2017
1 parent 810d62b commit fa99d41
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 52 deletions.
27 changes: 0 additions & 27 deletions Docker_entrypoint.sh

This file was deleted.

33 changes: 16 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
FROM alpine:edge
FROM chenhw2/alpine:base
MAINTAINER CHENHW2 <https://github.com/chenhw2>

ARG BIN_URL=https://github.com/chenhw2/aliyun-ddns-cli/releases/download/v20170413/aliddns_linux-amd64-20170413.tar.gz
ARG VER=20170715
ARG URL=https://github.com/chenhw2/aliyun-ddns-cli/releases/download/v$VER/aliddns_linux-amd64-$VER.tar.gz

RUN apk add --update --no-cache wget supervisor ca-certificates \
&& update-ca-certificates \
&& rm -rf /var/cache/apk/*

RUN mkdir -p /opt \
&& cd /opt \
&& wget -qO- ${BIN_URL} | tar xz \
RUN mkdir -p /usr/bin \
&& cd /usr/bin \
&& wget -qO- ${URL} | tar xz \
&& mv aliddns_* aliddns

ENV AccessKeyID=1234567890 \
AccessKeySecret=abcdefghijklmn \
Domain=ddns.example.win \
Redo=0

ADD Docker_entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENV AKID=1234567890 \
AKSCT=abcdefghijklmn \
DOMAIN=ddns.example.win \
REDO=0

ENTRYPOINT ["/entrypoint.sh"]
CMD aliddns \
--id ${AKID} \
--secret ${AKSCT} \
auto-update \
--domain ${DOMAIN} \
--redo ${REDO}
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@
$ docker pull chenhw2/aliyun-ddns-cli
$ docker run -d \
-e "AccessKeyID=1234567890" \
-e "AccessKeySecret=abcdefghijklmn" \
-e "AcceDomain=ddns.example.winssKeyID" \
-e "Redo=600" \
-e "AKID=[ALIYUN's AccessKey-ID]" \
-e "AKSCT=[ALIYUN's AccessKey-Secret]" \
-e "DOMAIN=ddns.aliyun.win" \
-e "REDO=600" \
chenhw2/aliyun-ddns-cli
```

### Example (for Synology)
- https://github.com/chenhw2/aliyun-ddns-cli/tree/master/example

### Help
```
$ docker run --rm chenhw2/aliyun-ddns-cli -h
Expand Down Expand Up @@ -46,8 +49,8 @@ GLOBAL OPTIONS:
--access-key-secret value, --secret value AliYun's Access Key Secret
--help, -h show help
--version, -v print the version
```

### CLI Example:
```
aliddns --id ${AccessKeyID} --secret ${AccessKeySecret} \
Expand All @@ -56,5 +59,4 @@ aliddns --id ${AccessKeyID} --secret ${AccessKeySecret} \
aliddns --id ${AccessKeyID} --secret ${AccessKeySecret} \
update --domain ddns.example.win \
--ipaddr $(ifconfig pppoe-wan | sed -n '2{s/[^0-9]*://;s/[^0-9.].*//p}')
```
```
Binary file added example/Synology_Docker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

1 comment on commit fa99d41

@hukecolin
Copy link

Choose a reason for hiding this comment

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

The use of errors in DSM 6.1-15047 is as follows:
AliyunGoClientFailure Message: json: cannot unmarshal string into Go struct field RecordType.TTL of type int32

Please sign in to comment.