Skip to content

Commit ac5992b

Browse files
authored
Merge pull request #239 from crazy-max/debian-base
Dockerfile: debian based build
2 parents 2f246b8 + 205638e commit ac5992b

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: build
22

3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
37
on:
48
workflow_dispatch:
59
push:
@@ -150,7 +154,7 @@ jobs:
150154
-
151155
name: Check artifacts
152156
run: |
153-
find ${{ env.DESTDIR }} -type f -exec file -e ascii -- {} +
157+
find ${{ env.DESTDIR }} -type f -exec file -e ascii -e text -- {} +
154158
-
155159
name: Upload artifacts
156160
uses: actions/upload-artifact@v3

Dockerfile

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
ARG GO_VERSION=1.18.5
44
ARG XX_VERSION=1.1.2
5-
ARG OSXCROSS_VERSION=11.3-r7-alpine
5+
ARG OSXCROSS_VERSION=11.3-r7-debian
66
ARG GOLANGCI_LINT_VERSION=v1.47.3
7+
ARG DEBIAN_FRONTEND=noninteractive
78

89
ARG PACKAGE=github.com/docker/docker-credential-helpers
910

@@ -13,9 +14,10 @@ FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
1314
# osxcross contains the MacOSX cross toolchain for xx
1415
FROM crazymax/osxcross:${OSXCROSS_VERSION} AS osxcross
1516

16-
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine AS gobase
17+
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-bullseye AS gobase
1718
COPY --from=xx / /
18-
RUN apk add --no-cache clang file git lld llvm make pkgconf rsync
19+
ARG DEBIAN_FRONTEND
20+
RUN apt-get update && apt-get install -y --no-install-recommends clang dpkg-dev file git lld llvm make pkg-config rsync
1921
ENV GOFLAGS="-mod=vendor"
2022
ENV CGO_ENABLED="1"
2123
WORKDIR /src
@@ -49,33 +51,38 @@ RUN --mount=type=bind,target=.,rw <<EOT
4951
fi
5052
EOT
5153

52-
FROM golangci/golangci-lint:${GOLANGCI_LINT_VERSION}-alpine AS golangci-lint
54+
FROM golangci/golangci-lint:${GOLANGCI_LINT_VERSION} AS golangci-lint
5355
FROM gobase AS lint
54-
RUN apk add musl-dev gcc libsecret-dev pass
56+
ARG DEBIAN_FRONTEND
57+
RUN apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config
5558
RUN --mount=type=bind,target=. \
5659
--mount=type=cache,target=/root/.cache \
5760
--mount=from=golangci-lint,source=/usr/bin/golangci-lint,target=/usr/bin/golangci-lint \
5861
golangci-lint run ./...
5962

6063
FROM gobase AS base
6164
ARG TARGETPLATFORM
62-
RUN xx-apk add musl-dev gcc libsecret-dev pass
65+
ARG DEBIAN_FRONTEND
66+
RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev pkg-config
6367

6468
FROM base AS test
65-
RUN xx-apk add gnome-keyring gpg-agent gnupg-gpgconf pass
69+
ARG DEBIAN_FRONTEND
70+
RUN xx-apt-get install -y dbus-x11 gnome-keyring gpg-agent gpgconf libsecret-1-dev pass
6671
RUN --mount=type=bind,target=. \
6772
--mount=type=cache,target=/root/.cache \
6873
--mount=type=cache,target=/go/pkg/mod <<EOT
6974
set -e
7075
cp -r .github/workflows/fixtures /root/.gnupg
7176
gpg-connect-agent "RELOADAGENT" /bye
7277
gpg --import --batch --yes /root/.gnupg/7D851EB72D73BDA0.key
73-
echo -e "trust\n5\ny" | gpg --batch --no-tty --command-fd 0 --edit-key 7D851EB72D73BDA0
78+
gpg --update-trustdb
79+
echo '5\ny\n' | gpg --command-fd 0 --no-tty --edit-key 7D851EB72D73BDA0 trust
7480
gpg-connect-agent "PRESET_PASSPHRASE 3E2D1142AA59E08E16B7E2C64BA6DDC773B1A627 -1 77697468207374757069642070617373706872617365" /bye
7581
gpg-connect-agent "KEYINFO 3E2D1142AA59E08E16B7E2C64BA6DDC773B1A627" /bye
7682
gpg-connect-agent "PRESET_PASSPHRASE BA83FC8947213477F28ADC019F6564A956456163 -1 77697468207374757069642070617373706872617365" /bye
7783
gpg-connect-agent "KEYINFO BA83FC8947213477F28ADC019F6564A956456163" /bye
7884
pass init 7D851EB72D73BDA0
85+
gpg -k
7986

8087
mkdir /out
8188
xx-go test -short -v -coverprofile=/out/coverage.txt -covermode=atomic ./...

pass/pass_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ func TestPassHelper(t *testing.T) {
1616
Secret: "isthebestmeshuggahalbum",
1717
}
1818

19+
_ = helper.CheckInitialized()
20+
1921
helper.Add(creds)
2022

2123
creds.ServerURL = "https://foobar.docker.io:9999/v2"

0 commit comments

Comments
 (0)