Commit 27205bb6 authored by Ivan Vandot's avatar Ivan Vandot Committed by GitHub

add support for slim docker image release (#1877)

parent a650d53d
......@@ -20,6 +20,27 @@ builds:
- arm
goarm:
- 7
- id: linux-slim
main: ./cmd/bee
binary: bee-slim
flags:
- -v
- -trimpath
ldflags:
- -s -w -X github.com/ethersphere/bee.version={{.Version}} -X github.com/ethersphere/bee.commit={{.ShortCommit}}
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm64
- arm
goarm:
- 7
hooks:
post:
- upx --best "{{ .Path }}"
- id: windows
main: ./cmd/bee
binary: bee
......@@ -78,6 +99,10 @@ archives:
-
name_template: "{{ tolower .ProjectName }}-{{ tolower .Os }}-{{ tolower .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
format: binary
builds:
- linux
- windows
- darwin
-
id: homebrew
builds:
......@@ -291,6 +316,52 @@ dockers:
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- image_templates:
- "ethersphere/bee:{{ .Version }}-amd64-slim"
- "quay.io/ethersphere/bee:{{ .Version }}-amd64-slim"
use_buildx: true
ids:
- linux-slim
goarch: amd64
dockerfile: Dockerfile.scratch
build_flag_templates:
- "--platform=linux/amd64"
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}-slim"
- image_templates:
- "ethersphere/bee:{{ .Version }}-armv7-slim"
- "quay.io/ethersphere/bee:{{ .Version }}-armv7-slim"
use_buildx: true
ids:
- linux-slim
goarch: arm
goarm: 7
dockerfile: Dockerfile.scratch
build_flag_templates:
- "--platform=linux/arm/v7"
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}-slim"
- image_templates:
- "ethersphere/bee:{{ .Version }}-arm64v8-slim"
- "quay.io/ethersphere/bee:{{ .Version }}-arm64v8-slim"
use_buildx: true
ids:
- linux-slim
goarch: arm64
dockerfile: Dockerfile.scratch
build_flag_templates:
- "--platform=linux/arm64/v8"
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}-slim"
docker_manifests:
- name_template: ethersphere/bee:{{ .Major }}
image_templates:
......@@ -342,3 +413,53 @@ docker_manifests:
- quay.io/ethersphere/bee:{{ .Version }}-amd64
- quay.io/ethersphere/bee:{{ .Version }}-armv7
- quay.io/ethersphere/bee:{{ .Version }}-arm64v8
- name_template: ethersphere/bee:{{ .Major }}-slim
image_templates:
- ethersphere/bee:{{ .Version }}-amd64-slim
- ethersphere/bee:{{ .Version }}-armv7-slim
- ethersphere/bee:{{ .Version }}-arm64v8-slim
- name_template: ethersphere/bee:{{ .Major }}.{{ .Minor }}-slim
image_templates:
- ethersphere/bee:{{ .Version }}-amd64-slim
- ethersphere/bee:{{ .Version }}-armv7-slim
- ethersphere/bee:{{ .Version }}-arm64v8-slim
- name_template: ethersphere/bee:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-slim
image_templates:
- ethersphere/bee:{{ .Version }}-amd64-slim
- ethersphere/bee:{{ .Version }}-armv7-slim
- ethersphere/bee:{{ .Version }}-arm64v8
- name_template: ethersphere/bee:latest-slim
image_templates:
- ethersphere/bee:{{ .Version }}-amd64-slim
- ethersphere/bee:{{ .Version }}-armv7-slim
- ethersphere/bee:{{ .Version }}-arm64v8-slim
- name_template: ethersphere/bee:beta-slim
image_templates:
- ethersphere/bee:{{ .Version }}-amd64-slim
- ethersphere/bee:{{ .Version }}-armv7-slim
- ethersphere/bee:{{ .Version }}-arm64v8-slim
- name_template: quay.io/ethersphere/bee:{{ .Major }}-slim
image_templates:
- quay.io/ethersphere/bee:{{ .Version }}-amd64-slim
- quay.io/ethersphere/bee:{{ .Version }}-armv7-slim
- quay.io/ethersphere/bee:{{ .Version }}-arm64v8-slim
- name_template: quay.io/ethersphere/bee:{{ .Major }}.{{ .Minor }}-slim
image_templates:
- quay.io/ethersphere/bee:{{ .Version }}-amd64-slim
- quay.io/ethersphere/bee:{{ .Version }}-armv7-slim
- quay.io/ethersphere/bee:{{ .Version }}-arm64v8-slim
- name_template: quay.io/ethersphere/bee:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-slim
image_templates:
- quay.io/ethersphere/bee:{{ .Version }}-amd64-slim
- quay.io/ethersphere/bee:{{ .Version }}-armv7-slim
- quay.io/ethersphere/bee:{{ .Version }}-arm64v8-slim
- name_template: quay.io/ethersphere/bee:latest-slim
image_templates:
- quay.io/ethersphere/bee:{{ .Version }}-amd64-slim
- quay.io/ethersphere/bee:{{ .Version }}-armv7-slim
- quay.io/ethersphere/bee:{{ .Version }}-arm64v8-slim
- name_template: quay.io/ethersphere/bee:beta-slim
image_templates:
- quay.io/ethersphere/bee:{{ .Version }}-amd64-slim
- quay.io/ethersphere/bee:{{ .Version }}-armv7-slim
- quay.io/ethersphere/bee:{{ .Version }}-arm64v8-slim
FROM debian:10.9-slim
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates; \
groupadd -r bee --gid 999; \
useradd -r -g bee --uid 999 --no-log-init -m bee;
# make sure mounted volumes have correct permissions
RUN mkdir -p /home/bee/.bee && chown 999:999 /home/bee/.bee
FROM scratch
COPY bee-slim /usr/local/bin/bee
COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs
COPY --from=0 /etc/passwd /etc/passwd
COPY --from=0 /home /home
EXPOSE 1633 1634 1635
USER bee
WORKDIR /home/bee
VOLUME /home/bee/.bee
ENTRYPOINT ["bee"]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment