Skip to content

Dockerfile: simplify utility-install script, and update gotestsum to v1.7.0#42674

Merged
thaJeztah merged 5 commits intomoby:masterfrom
thaJeztah:bump_gotestsum
Sep 2, 2021
Merged

Dockerfile: simplify utility-install script, and update gotestsum to v1.7.0#42674
thaJeztah merged 5 commits intomoby:masterfrom
thaJeztah:bump_gotestsum

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Jul 26, 2021

Dockerfile: use version for some utilities instead of commit-sha

The golangci-lint, gotestsum, shfmt, and vndr utilities should generally
be ok to be pinned by version instead of a specific sha. Also rename
the corresponding env-vars / build-args accordingly:

  • GOLANGCI_LINT_COMMIT -> GOLANGCI_LINT_VERSION
  • GOTESTSUM_COMMIT -> GOTESTSUM_VERSION
  • SHFMT_COMMIT -> SHFMT_VERSION
  • VNDR_COMMIT -> VNDR_VERSION
  • CONTAINERD_COMMIT -> CONTAINERD_VERSION
  • RUNC_COMMIT -> RUNC_VERSION
  • ROOTLESS_COMMIT -> ROOTLESS_VERSION

Dockerfile: use "go install" to install utilities

Dockerfile: remove GOPROXY override (was for go < 1.14)

Dockerfile: update gotestsum to v1.7.0

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah thaJeztah force-pushed the bump_gotestsum branch 2 times, most recently from 776f040 to f40bb6b Compare July 27, 2021 22:09
@thaJeztah thaJeztah marked this pull request as ready for review July 28, 2021 19:24
@thaJeztah thaJeztah requested a review from tianon as a code owner July 28, 2021 19:24
Copy link
Member Author

Choose a reason for hiding this comment

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

Wondering if we should just remove these scripts now, and inline this in the Dockerfile. WDYT @cpuguy83 @tianon ?

Copy link
Member Author

Choose a reason for hiding this comment

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

^^ I started working on this, but it was slightly more involved, so I'll push those changes in a follow-up.

Copy link
Member

Choose a reason for hiding this comment

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

You mean inline just the extra tools (like tomll), or all the containerd, etc too? I'm +1 on the former but hesitant on the latter (since I think those scripts get used elsewhere too right?)

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, correct, the containerd and runc scripts are still used in some other places, so we likely still need those. For the "CI utilities", I think we should be able to put them inside the dockerfile; they're just one-liners now, so having two scripts to run them is just unneeded overhead.

@thaJeztah thaJeztah force-pushed the bump_gotestsum branch 2 times, most recently from c3c0da9 to bd22a9b Compare August 23, 2021 13:21
@thaJeztah
Copy link
Member Author

thaJeztah commented Aug 23, 2021

Moving to draft, as this now depends on #42776

merged

@thaJeztah thaJeztah marked this pull request as draft August 23, 2021 13:22
@thaJeztah thaJeztah marked this pull request as ready for review August 27, 2021 17:30

# Do not build with ambient capabilities support
RUNC_BUILDTAGS="${RUNC_BUILDTAGS:-"seccomp $RUNC_NOKMEM"}"
RUNC_BUILDTAGS="${RUNC_BUILDTAGS:-"seccomp"}"
Copy link
Member Author

Choose a reason for hiding this comment

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

I think we can also consider removing RUNC_BUILDTAGS now (assuming that make static does the right thing w.r.t. seccomp 🤔

@thaJeztah
Copy link
Member Author

@tianon @cpuguy83 PTAL

Copy link
Member

@tianon tianon left a comment

Choose a reason for hiding this comment

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

Seems sane to me 👍

Copy link
Member

Choose a reason for hiding this comment

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

You mean inline just the extra tools (like tomll), or all the containerd, etc too? I'm +1 on the former but hesitant on the latter (since I think those scripts get used elsewhere too right?)

git clone https://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc"
cd "$GOPATH/src/github.com/opencontainers/runc"
git checkout -q "$RUNC_COMMIT"
cd "$GOPATH/src/github.com/opencontainers/runc" || true
Copy link
Member Author

Choose a reason for hiding this comment

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

changing this for -e instead

This build-tag was removed in opencontainers/runc@52390d6,
which is part of runc v1.0.0-rc94 and up, so no longer relevant.

the kmem options are now always disabled in runc.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The golangci-lint, gotestsum, shfmt, and vndr utilities should generally
be ok to be pinned by version instead of a specific sha. Also rename
the corresponding env-vars / build-args accordingly:

- GOLANGCI_LINT_COMMIT -> GOLANGCI_LINT_VERSION
- GOTESTSUM_COMMIT -> GOTESTSUM_VERSION
- SHFMT_COMMIT -> SHFMT_VERSION
- VNDR_COMMIT -> VNDR_VERSION
- CONTAINERD_COMMIT -> CONTAINERD_VERSION
- RUNC_COMMIT -> RUNC_VERSION
- ROOTLESS_COMMIT -> ROOTLESS_VERSION

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Member Author

@tonistiigi updated; added set -e to the runc.installer

@thaJeztah thaJeztah merged commit 5176095 into moby:master Sep 2, 2021
@thaJeztah thaJeztah deleted the bump_gotestsum branch September 2, 2021 21:24
Comment on lines -34 to -38
# TODO remove GOPROXY override once we updated to Go 1.14+
# Using goproxy instead of "direct" to work around an issue in go mod
# on Go 1.13 not working with older git versions (default version on
# CentOS 7 is git 1.8), see https://github.com/golang/go/issues/38373
export GOPROXY="https://proxy.golang.org"
Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like this issue was not fixed in Go 1.14. go modules still doesn't work (without using the proxy) on CentOS 7 / older git versions; docker/docker-ce-packaging#553 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants