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

Set capabilities in the builder Docker image instead of the final #5073

Merged
merged 1 commit into from
Jul 6, 2024

Conversation

rdner
Copy link
Member

@rdner rdner commented Jul 5, 2024

This significantly reduces the size of the image.

How to test this PR locally

PLATFORMS=linux/arm64 PACKAGES=docker mage package

Before this change:

REPOSITORY                                       TAG          IMAGE ID       CREATED         SIZE
docker.elastic.co/beats/elastic-agent-complete   8.15.0       1452af5ad002   4 minutes ago   2.36GB
docker.elastic.co/beats-ci/elastic-agent-cloud   8.15.0       fa0bc74c04ce   6 minutes ago   1.2GB
docker.elastic.co/beats/elastic-agent            8.15.0       cb118fa60f56   6 minutes ago   852MB
docker.elastic.co/beats/elastic-agent-ubi        8.15.0       0f3615fb5329   6 minutes ago   916MB
docker.elastic.co/beats-dev/golang-crossbuild    1.22.5-arm   0805c9714ddf   27 hours ago    752MB

After this change:

REPOSITORY                                       TAG          IMAGE ID       CREATED         SIZE
docker.elastic.co/beats/elastic-agent-complete   8.15.0       168b8aff9ca3   2 minutes ago   2.09GB
docker.elastic.co/beats-ci/elastic-agent-cloud   8.15.0       d0c156eaa4b4   5 minutes ago   939MB
docker.elastic.co/beats/elastic-agent            8.15.0       534200a70c76   5 minutes ago   588MB
docker.elastic.co/beats/elastic-agent-ubi        8.15.0       165729671f4e   5 minutes ago   652MB
docker.elastic.co/beats-dev/golang-crossbuild    1.22.5-arm   0805c9714ddf   28 hours ago    752MB
docker run -u root -it --entrypoint /bin/bash docker.elastic.co/beats/elastic-agent:8.15.0
apt-get install libcap2-bin
getcap data/elastic-agent-ee237a/components/agentbeat

it should output:

data/elastic-agent-ee237a/components/agentbeat = cap_setuid,cap_net_raw+p

Related issues

This significantly reduces the size of the image.
@rdner rdner added enhancement New feature or request Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Team:Elastic-Agent Label for the Agent team backport-v8.14.0 Automated backport with mergify backport-8.15 Automated backport to the 8.15 branch with mergify labels Jul 5, 2024
@rdner rdner self-assigned this Jul 5, 2024
@rdner rdner requested a review from a team as a code owner July 5, 2024 20:08
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@rdner rdner requested review from cmacknz and emilioalvap and removed request for blakerouse and michel-laterman July 5, 2024 20:10
@rdner rdner mentioned this pull request Jul 5, 2024
3 tasks
@rdner rdner enabled auto-merge (squash) July 5, 2024 20:17
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@rdner rdner merged commit ac85520 into elastic:main Jul 6, 2024
18 checks passed
mergify bot pushed a commit that referenced this pull request Jul 6, 2024
)

This significantly reduces the size of the image.

(cherry picked from commit ac85520)
mergify bot pushed a commit that referenced this pull request Jul 6, 2024
)

This significantly reduces the size of the image.

(cherry picked from commit ac85520)
@rdner rdner deleted the optimize-docker-image-size branch July 6, 2024 17:23
rdner added a commit that referenced this pull request Jul 6, 2024
) (#5077)

This significantly reduces the size of the image.

(cherry picked from commit ac85520)

Co-authored-by: Denis <[email protected]>
rdner added a commit that referenced this pull request Jul 9, 2024
) (#5076)

This significantly reduces the size of the image.

(cherry picked from commit ac85520)

Co-authored-by: Denis <[email protected]>
@rdner rdner mentioned this pull request Aug 15, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.15 Automated backport to the 8.15 branch with mergify backport-v8.14.0 Automated backport with mergify enhancement New feature or request Team:Elastic-Agent Label for the Agent team Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants