diff --git a/aws-cli/Dockerfile b/aws-cli/Dockerfile new file mode 100644 index 0000000..64a499f --- /dev/null +++ b/aws-cli/Dockerfile @@ -0,0 +1,23 @@ +FROM alpine:3.6 + +# Versions: https://pypi.python.org/pypi/awscli#downloads +ENV AWS_CLI_VERSION 1.15.47 +ENV SCHEDULE **None** + +RUN apk --no-cache update && \ +apk --no-cache add python py-pip py-setuptools ca-certificates groff less && \ +pip --no-cache-dir install awscli==${AWS_CLI_VERSION} && \ +rm -rf /var/cache/apk/* + +# install go-cron +RUN apk add --no-cache curl && \ + curl -L --insecure https://github.com/odise/go-cron/releases/download/v0.0.6/go-cron-linux.gz | zcat > /usr/local/bin/go-cron && \ + chmod u+x /usr/local/bin/go-cron && apk del curl + +ADD run.sh /opt/s3cmd/run.sh +RUN chmod a+x /opt/s3cmd/run.sh + +ENTRYPOINT ["/opt/s3cmd/run.sh"] + + +WORKDIR /data diff --git a/aws-cli/bar.txt b/aws-cli/bar.txt new file mode 100644 index 0000000..1715acd --- /dev/null +++ b/aws-cli/bar.txt @@ -0,0 +1 @@ +foo1 diff --git a/aws-cli/run.sh b/aws-cli/run.sh new file mode 100644 index 0000000..b60f2fa --- /dev/null +++ b/aws-cli/run.sh @@ -0,0 +1,11 @@ +#! /bin/sh + +set -e + +echo "Running s3cmd ..." + +if [ "${SCHEDULE}" = "**None**" ]; then + aws "$@" +else + exec go-cron "$SCHEDULE" aws "$@" +fi