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

Distroless base image for crd-client #3277

Merged
merged 5 commits into from
Jul 25, 2023

Conversation

Kalaiselvi84
Copy link
Contributor

What type of PR is this?

Uncomment only one /kind <> line, press enter to put that in a new line, and remove leading whitespace from that line:

/kind breaking
/kind bug

/kind cleanup

/kind documentation
/kind feature
/kind hotfix
/kind release

What this PR does / Why we need it:

Which issue(s) this PR fixes:

Closes #909

Special notes for your reviewer:

@github-actions github-actions bot added the kind/cleanup Refactoring code, fixing up documentation, etc label Jul 19, 2023
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: d2c26147-12ff-4132-b51b-850dcdc99e75

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3277/head:pr_3277 && git checkout pr_3277
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.34.0-dev-9b18763-amd64

@@ -25,7 +25,7 @@

REPOSITORY ?= us-docker.pkg.dev/agones-images/examples

server_tag = $(REPOSITORY)/crd-client:0.9
server_tag = $(REPOSITORY)/crd-client:1.0
Copy link
Member

Choose a reason for hiding this comment

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

@markmandel - how do you feel about going from 0.9 to 1.0 vs. 0.9 to 0.10? Are we happy calling this image a 1.0 image?

Copy link
Member

Choose a reason for hiding this comment

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

That's a good point - I figure let's go to 0.10 -- examples can always change I guess (or at least we should be consistent with our examples).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've changed it to 0.10

@@ -14,21 +14,18 @@

# Gather dependencies and build the executable
FROM golang:1.20.4 as builder
WORKDIR /go/src/crd-client
WORKDIR /
Copy link
Member

Choose a reason for hiding this comment

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

I'm curious why you changed the paths in the build container. That shouldn't affect the location in the final container.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mark suggested moving the WORKDIR path to the root directory ('/').
Example PR: https://github.com/googleforgames/agones/pull/3270/files

Copy link
Member

Choose a reason for hiding this comment

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

I was being consistent with everything else I've seen with distroless / done with distroless.

There's no $HOME folders in distroless, so it seems like everyone drops everything in /.

Copy link
Member

Choose a reason for hiding this comment

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

Oh sorry, I should have looked at this properly - this is the build step.

🤷🏻 actually for this, I have no strong opinion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Based on testing, the change to the root directory ('/') for WORKDIR in the build container didn't work as expected, so I've reverted it back.


COPY --from=builder /go/src/crd-client \
/home/client
COPY --from=builder /client /
Copy link
Member

Choose a reason for hiding this comment

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

I do like just copying the binary over; that seems like an improvement from the previous commands. 👍

@markmandel
Copy link
Member

For testing for this -- take as standard release/dev Agones install, create this as an image and apply the yaml - it's shouldn't fail, and you can see the output in it's logs.

You can see a step through here:
https://agones.dev/site/docs/guides/access-api/#example

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 0ecbab4f-836c-4021-8833-4db0282a1451

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3277/head:pr_3277 && git checkout pr_3277
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.34.0-dev-6376761-amd64

@markmandel markmandel enabled auto-merge (squash) July 20, 2023 23:45
@markmandel markmandel disabled auto-merge July 20, 2023 23:45
@google-oss-prow google-oss-prow bot added size/XL and removed size/S labels Jul 24, 2023
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 64a68baa-45ad-4e73-8b88-0dab2e69fd61

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3277/head:pr_3277 && git checkout pr_3277
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.34.0-dev-c66e526-amd64

Copy link
Member

@markmandel markmandel left a comment

Choose a reason for hiding this comment

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

Nice!

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Kalaiselvi84, markmandel

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@markmandel markmandel enabled auto-merge (squash) July 24, 2023 21:52
@google-oss-prow google-oss-prow bot removed the lgtm label Jul 24, 2023
@google-oss-prow
Copy link

New changes are detected. LGTM label has been removed.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 369fdf28-2264-4835-9a55-c36658aa7d3d

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3277/head:pr_3277 && git checkout pr_3277
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.34.0-dev-eb925f5-amd64

@markmandel markmandel merged commit 9980cc8 into googleforgames:main Jul 25, 2023
2 checks passed
@Kalaiselvi84 Kalaiselvi84 deleted the issues/291828118 branch March 15, 2024 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved kind/cleanup Refactoring code, fixing up documentation, etc size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should we rebase images from alpine to gcr.io/distroless/static ?
4 participants