From 6e1b078565c782c2f060eb157694dbb1f98af806 Mon Sep 17 00:00:00 2001 From: Alexander Baryshnikov Date: Wed, 17 Jun 2020 16:12:24 +0800 Subject: [PATCH] build: add docker minimal image --- .goreleaser.yml | 21 ++++++++++++++++++++- Dockerfile | 2 +- Dockerfile.minimal | 9 +++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 Dockerfile.minimal diff --git a/.goreleaser.yml b/.goreleaser.yml index ee931fb..9d9608e 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -32,6 +32,8 @@ builds: - 7 goos: - linux + - windows + - darwin flags: - -trimpath nfpms: @@ -78,17 +80,34 @@ archives: - replacements: Linux: linux 386: i386 + windows: ctl_windows + darwin: ctl_darwin name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" files: - LICENSE - README.md format: tar.gz + format_overrides: + - goos: windows + format: zip dockers: - - image_templates: + - binaries: + - trusted-cgi + dockerfile: Dockerfile + image_templates: - "reddec/trusted-cgi:{{ .Tag }}" - "reddec/trusted-cgi:v{{ .Major }}" - "reddec/trusted-cgi:v{{ .Major }}.{{ .Minor }}" - "reddec/trusted-cgi:latest" + + - binaries: + - trusted-cgi + dockerfile: Dockerfile.minimal + image_templates: + - "reddec/trusted-cgi:{{ .Tag }}-light" + - "reddec/trusted-cgi:v{{ .Major }}-light" + - "reddec/trusted-cgi:v{{ .Major }}.{{ .Minor }}-light" + - "reddec/trusted-cgi:latest-light" checksum: name_template: 'checksums.txt' snapshot: diff --git a/Dockerfile b/Dockerfile index 0194829..ef7a1ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM nimlang/nim:alpine -RUN apk add --no-cache python3 py3-setuptools py3-virtualenv php nodejs npm make +RUN apk add --no-cache python3 py3-setuptools py3-virtualenv php nodejs npm make git EXPOSE 3434 VOLUME /data WORKDIR /data diff --git a/Dockerfile.minimal b/Dockerfile.minimal new file mode 100644 index 0000000..68ab318 --- /dev/null +++ b/Dockerfile.minimal @@ -0,0 +1,9 @@ +FROM alpine:3.11 +RUN apk add --no-cache make +EXPOSE 3434 +VOLUME /data +WORKDIR /data +ENV INITIAL_ADMIN_PASSWORD admin +ENV BIND 0.0.0.0:3434 +COPY trusted-cgi / +ENTRYPOINT ["/trusted-cgi", "--disable-chroot"] \ No newline at end of file