Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile: debian based build #239

Merged
merged 2 commits into from Aug 31, 2022
Merged

Conversation

crazy-max
Copy link
Member

@crazy-max crazy-max commented Aug 30, 2022

follow-up #237 (comment)

using musl to build dynamically linked secretservice helper is not suitable so switch to debian based as it is for current released binaries.

Signed-off-by: CrazyMax crazy-max@users.noreply.github.com

@codecov-commenter
Copy link

codecov-commenter commented Aug 30, 2022

Codecov Report

Merging #239 (d15999e) into master (2f246b8) will decrease coverage by 12.17%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           master     #239       +/-   ##
===========================================
- Coverage   55.25%   43.08%   -12.18%     
===========================================
  Files           9        7        -2     
  Lines         666      448      -218     
===========================================
- Hits          368      193      -175     
+ Misses        255      224       -31     
+ Partials       43       31       -12     
Impacted Files Coverage Δ
pass/pass.go 53.98% <0.00%> (-11.51%) ⬇️
wincred/wincred_windows.go
osxkeychain/osxkeychain_darwin.go

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Dockerfile Outdated

FROM base AS test
RUN xx-apk add gnome-keyring gpg-agent gnupg-gpgconf pass
FROM golang:${GO_VERSION}-alpine AS test
Copy link
Member Author

@crazy-max crazy-max Aug 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately can't make sandboxed test work with debian base image 😞

it seems gpg or pass does not behave like on alpine:

#15 0.721 ok    github.com/docker/docker-credential-helpers/credentials 0.002s  coverage: 58.5% of statements
#15 0.752 === RUN   TestPassHelper
#15 0.752     pass_test.go:20: exit status 1: gpg: WARNING: unsafe permissions on homedir '/root/.gnupg'
#15 0.752         gpg: 0xD523BD50DD70B0BA: There is no assurance this key belongs to the named user
#15 0.752         gpg: cannot open '/dev/tty': No such device or address
#15 0.752         Password encryption aborted.
#15 0.752
#15 0.752 --- FAIL: TestPassHelper (0.02s)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah found the issue, on debian based we have to change the trust level command to:

echo '5\ny\n' | gpg --command-fd 0 --no-tty --edit-key 7D851EB72D73BDA0 trust

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the permissions, we could probably also try to fix by setting the directory permissions when we create the directory (I recall I made that change when I was looking into things)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the permissions, we could probably also try to fix by setting the directory permissions when we create the directory (I recall I made that change when I was looking into things)

Yes we could take a look in a follow-up for this one 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, was thinking; add a mkdir (and chmod if needed) here;

cp -r .github/workflows/fixtures /root/.gnupg

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
@@ -13,9 +14,10 @@ FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
# osxcross contains the MacOSX cross toolchain for xx
FROM crazymax/osxcross:${OSXCROSS_VERSION} AS osxcross

FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine AS gobase
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-bullseye AS gobase
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know if -buster would work on both "bullseye" and "buster", or would that break? I recall the containerd maintainers had to downgrade their machines to ubuntu 18.04 to make them more compatible; containerd/containerd@v1.6.7...v1.6.8

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I was also wondering what was our best option. I will try and let you know.

Copy link
Member Author

@crazy-max crazy-max Aug 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ppc64le, s390x and armel (arm/v6) cross pkgs are not available in buster 😣 only in buster-backports afaik. also looking at release 0.6.4 it seems binaries were built on bullseye.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright; if we already used bullseye, then it's probably fine

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah thaJeztah merged commit ac5992b into docker:master Aug 31, 2022
@crazy-max crazy-max deleted the debian-base branch August 31, 2022 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants