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

Update Ubuntu 20.04 with 24.04 for Docker base images #40942

Merged

Conversation

vinit-chauhan
Copy link
Contributor

@vinit-chauhan vinit-chauhan commented Sep 22, 2024

Proposed commit message

Update Ubuntu 20.04 with 22.04 24.04 for Docker base images.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Disruptive User Impact

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

@vinit-chauhan vinit-chauhan requested a review from a team as a code owner September 22, 2024 18:41
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Sep 22, 2024
Copy link
Contributor

mergify bot commented Sep 22, 2024

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @vinit-chauhan? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit

Copy link
Contributor

mergify bot commented Sep 22, 2024

backport-8.x has been added to help with the transition to the new branch 8.x.
If you don't need it please use backport-skip label and remove the backport-8.x label.

@mergify mergify bot added the backport-8.x Automated backport to the 8.x branch with mergify label Sep 22, 2024
@pierrehilbert pierrehilbert added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Sep 23, 2024
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Sep 23, 2024
@pierrehilbert
Copy link
Collaborator

/test

@pierrehilbert
Copy link
Collaborator

run docs-build

Copy link
Member

@mauri870 mauri870 left a comment

Choose a reason for hiding this comment

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

LGTM, this seems to be the only occurrences of the ubuntu image in beats. I'm not sure if there are other places we should upgrade this as well.

@mauri870
Copy link
Member

Adding @andrzej-stencel as reviewer since it is the assignee for the issue.

@vinit-chauhan
Copy link
Contributor Author

LGTM, this seems to be the only occurrences of the ubuntu image in beats. I'm not sure if there are other places we should upgrade this as well.

AFAIK, In all other beat-specific Dockerfiles we use the golang image as the base image.
We are only using Ubuntu images once to package Linux images for Beats.

@pierrehilbert
Copy link
Collaborator

/test

@pierrehilbert
Copy link
Collaborator

run docs-build

@pierrehilbert
Copy link
Collaborator

run docs-build

@pierrehilbert
Copy link
Collaborator

/test

@andrzej-stencel
Copy link
Contributor

andrzej-stencel commented Oct 1, 2024

The issue was actually updated to go from 20.04 straight to 24.04, skipping 22.04. @vinit-chauhan do you think you can update this pull request to move to 24.04?

@vinit-chauhan
Copy link
Contributor Author

Hey @andrzej-stencel - thanks for mentioning the changed title. I'll update the PR.

CHANGELOG.next.asciidoc Outdated Show resolved Hide resolved
@vinit-chauhan
Copy link
Contributor Author

Thanks @jlind23 - I was about to update the branch. 😄

I've updated it. Take a look and let me know if there are any changes.

@vinit-chauhan vinit-chauhan changed the title Update Ubuntu 20.04 with 22.04 for Docker base images Update Ubuntu 20.04 with 24.04 for Docker base images Oct 1, 2024
@jlind23
Copy link
Collaborator

jlind23 commented Oct 2, 2024

Thanks @vinit-chauhan, this looks good to me now.

@jlind23
Copy link
Collaborator

jlind23 commented Oct 2, 2024

buildkite test it

@jlind23
Copy link
Collaborator

jlind23 commented Oct 2, 2024

/test

@jlind23
Copy link
Collaborator

jlind23 commented Oct 2, 2024

run docs-build

@jlind23 jlind23 enabled auto-merge (squash) October 2, 2024 06:58
Copy link
Contributor

@andrzej-stencel andrzej-stencel left a comment

Choose a reason for hiding this comment

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

Awesome, thanks a lot Vinit!

@andrzej-stencel
Copy link
Contributor

Right, the image build fails with the error:

 => ERROR [stage-1 10/12] RUN groupadd --gid 1000 auditbeat                                                                                                0.2s
------
 > [stage-1 10/12] RUN groupadd --gid 1000 auditbeat:
0.192 groupadd: GID '1000' already exists

I had the same issue in the upgrade for the Elastic Agent repo: elastic/elastic-agent#5644.

This is because the Ubuntu 24.04 container images now already include user ubuntu that has uid and gid 1000, see https://askubuntu.com/questions/1513927/ubuntu-24-04-docker-images-now-includes-user-ubuntu-with-uid-gid-1000 and https://bugs.launchpad.net/cloud-images/+bug/2005129.

I recommend to fix this the same way as I did it in my PR: by removing the ubuntu user. Can you apply the fix @vinit-chauhan? I presume it would be in this file: https://github.com/elastic/beats/blob/main/dev-tools/packaging/templates/docker/Dockerfile.tmpl.

auto-merge was automatically disabled October 2, 2024 19:19

Head branch was pushed to by a user without write access

@vinit-chauhan
Copy link
Contributor Author

Hey @andrzej-stencel - I have updated the code. Let me know if there are any further changes.

Also, Would you please run the tests?

@vinit-chauhan vinit-chauhan force-pushed the upgrade_base_image_docker_build branch from 037692e to ce68c08 Compare October 2, 2024 19:29
@pierrehilbert
Copy link
Collaborator

/test

@pierrehilbert
Copy link
Collaborator

run docs-build

@jlind23
Copy link
Collaborator

jlind23 commented Oct 7, 2024

run docs-build

@jlind23
Copy link
Collaborator

jlind23 commented Oct 7, 2024

/test

@pierrehilbert
Copy link
Collaborator

run docs-build

@pierrehilbert
Copy link
Collaborator

/test

@pierrehilbert pierrehilbert merged commit 4c1489d into elastic:main Oct 8, 2024
143 checks passed
mergify bot pushed a commit that referenced this pull request Oct 8, 2024
* Replace Ubuntu 20.04 with 22.04 for Docker base images

* Added link to pull request in CHANGELOG.next.asciidoc

* update to ubuntu:24.04

Co-authored-by: Julien Lind <[email protected]>

* remove default ubuntu user in 24.04 while generating container.

---------

Co-authored-by: Mauri de Souza Meneguzzo <[email protected]>
Co-authored-by: Julien Lind <[email protected]>
Co-authored-by: Andrzej Stencel <[email protected]>
(cherry picked from commit 4c1489d)
pierrehilbert pushed a commit that referenced this pull request Oct 8, 2024
* Replace Ubuntu 20.04 with 22.04 for Docker base images

* Added link to pull request in CHANGELOG.next.asciidoc

* update to ubuntu:24.04

Co-authored-by: Julien Lind <[email protected]>

* remove default ubuntu user in 24.04 while generating container.

---------

Co-authored-by: Mauri de Souza Meneguzzo <[email protected]>
Co-authored-by: Julien Lind <[email protected]>
Co-authored-by: Andrzej Stencel <[email protected]>
(cherry picked from commit 4c1489d)

Co-authored-by: Vinit Chauhan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.x Automated backport to the 8.x branch with mergify Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace Ubuntu 20.04 with 24.04 for Docker base images
6 participants