Skip to content

Commit ab90d5e

Browse files
committed
Perform release builds in Debian instead of Alpine
1 parent 6f6d9a6 commit ab90d5e

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

Dockerfile.release

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
FROM golang:1.13-alpine3.11
1+
FROM golang:1.13-buster
22

3-
RUN apk add --no-cache \
3+
SHELL ["bash", "-Eeuo", "pipefail", "-xc"]
4+
5+
RUN apt-get update; \
6+
apt-get install -y --no-install-recommends \
47
file \
5-
gnupg
8+
gnupg dirmngr \
9+
wget \
10+
; \
11+
rm -rf /var/lib/apt/lists/*
612

713
WORKDIR /usr/src/bashbrew
814
ENV CGO_ENABLED 0
@@ -27,9 +33,7 @@ ENV MANIFEST_TOOL_VERSION 1.0.2
2733
# gpg: key 0F386284C03A1162: public key "Philip Estes <[email protected]>" imported
2834
ENV MANIFEST_TOOL_GPG_KEY 27F3EA268A97867EAF0BD05C0F386284C03A1162
2935

30-
RUN set -euxo pipefail; \
31-
\
32-
export GNUPGHOME="$(mktemp -d)"; \
36+
RUN export GNUPGHOME="$(mktemp -d)"; \
3337
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$MANIFEST_TOOL_GPG_KEY"; \
3438
\
3539
mkdir -p bin; \
@@ -43,7 +47,7 @@ RUN set -euxo pipefail; \
4347
srcBin="$srcBin$ext"; \
4448
targetBin="bin/manifest-tool-$bashbrewArch$ext"; \
4549
wget -O "$targetBin.asc" "https://github.com/estesp/manifest-tool/releases/download/v${MANIFEST_TOOL_VERSION}/$srcBin.asc"; \
46-
wget -O "$targetBin" "https://github.com/estesp/manifest-tool/releases/download/v${MANIFEST_TOOL_VERSION}/$srcBin"; \
50+
wget -O "$targetBin" "https://github.com/estesp/manifest-tool/releases/download/v${MANIFEST_TOOL_VERSION}/$srcBin" --progress=dot:giga; \
4751
gpg --batch --verify "$targetBin.asc" "$targetBin"; \
4852
ls -lAFh "$targetBin"*; \
4953
file "$targetBin"*; \
@@ -58,16 +62,20 @@ RUN set -euxo pipefail; \
5862

5963
COPY . .
6064

61-
RUN set -euxo pipefail; \
62-
\
63-
for bashbrewArch in $BASHBREW_ARCHES; do \
65+
RUN for bashbrewArch in $BASHBREW_ARCHES; do \
6466
( \
6567
goEnv="$(bashbrew-arch-to-goenv.sh "$bashbrewArch")"; eval "$goEnv"; \
6668
[ "$GOOS" = 'windows' ] && ext='.exe' || ext=; \
6769
\
70+
LDFLAGS='-s -w'; \
71+
case "$GOOS" in \
72+
darwin | windows) ;; \
73+
*) LDFLAGS+=' -d' ;; \
74+
esac; \
75+
\
6876
targetBin="bin/bashbrew-$bashbrewArch$ext"; \
6977
go build \
70-
-v -ldflags '-s -w' \
78+
-v -ldflags "$LDFLAGS" \
7179
-tags netgo -installsuffix netgo \
7280
-o "$targetBin" \
7381
-mod vendor \

scripts/bashbrew-arch-to-goenv.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
2-
set -euo pipefail
2+
set -eu
33

44
# usage: (from within another script)
55
# eval "$(./.bashbrew-arch-to-goenv.sh)"

0 commit comments

Comments
 (0)