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

Remove software-properties-common from dev container after use #7255

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

thanodnl
Copy link
Member

During the creation of the devcontainer we need to add a ppa repository, which is easiest done via software-properies-common. As turns out this installes pkexec into the container as a side effect.

When vscode tries to attach a debugger it first checks if pkexec is installed as this gives a nicer popup asking for elevation of rights to attach to the process. However, since dev containers don't have a windowing system running pkexec isn't working as expected and thus prevents the debugger from attaching.

Without pkexec in the container vscode 'falls back' to plain old sudo which we can run passwordless in the container.

For pkexec to be removed we need to first purge software-propertied-common as well as autoremove all packages that were installed due to the installation of said package. By performing this all in one step we minimize the size of the layer we are creating.

During the creation of the devcontainer we need to add a ppa
repository, which is easiest done via software-properies-common.
As turns out this installes pkexec into the container as a side
effect.

When vscode tries to attach a debugger it first checks if
pkexec is installed as this gives a nicer popup asking for
elevation of rights to attach to the process. However, since dev
containers don't have a windowing system running pkexec isn't
working as expected and thus prevents the debugger from attaching.

Without pkexec in the container vscode 'falls back' to plain old sudo
which we can run passwordless in the container.

For pkexec to be removed we need to first purge software-propertied-common
as well as autoremove all packages that were installed due to the
installation of said package. By performing this all in one step we
minimize the size of the layer we are creating.
@thanodnl thanodnl added the devcontainer Optimizations against the development container label Oct 12, 2023
@thanodnl thanodnl requested a review from JelteF October 12, 2023 14:38
@@ -109,7 +113,7 @@ WORKDIR /uncrustify/uncrustify-uncrustify-0.68.1/
RUN mkdir build
WORKDIR /uncrustify/uncrustify-uncrustify-0.68.1/build/
RUN cmake ..
RUN make -sj8
RUN MAKEFLAGS="-j $(nproc)" make -s
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 know, this could have been a separate PR, but YOLO

I just happened to see this was still hardcoded to the arbitrary 8 parallel jobs. It is only applicable during the building of the devcontainer, but this allows bigger github actions to actually do something significant it ever required.

@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

Merging #7255 (6eab051) into main (e0b0cdb) will decrease coverage by 0.02%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #7255      +/-   ##
==========================================
- Coverage   93.22%   93.21%   -0.02%     
==========================================
  Files         275      275              
  Lines       59492    59539      +47     
  Branches        0     7419    +7419     
==========================================
+ Hits        55462    55499      +37     
- Misses       4030     4040      +10     

@thanodnl thanodnl merged commit fb08f9b into main Oct 12, 2023
121 of 125 checks passed
@thanodnl thanodnl deleted the fix/devcontainer-pkexec branch October 12, 2023 15:47
francisjodi pushed a commit that referenced this pull request Nov 13, 2023
During the creation of the devcontainer we need to add a ppa repository,
which is easiest done via software-properies-common. As turns out this
installes pkexec into the container as a side effect.

When vscode tries to attach a debugger it first checks if pkexec is
installed as this gives a nicer popup asking for elevation of rights to
attach to the process. However, since dev containers don't have a
windowing system running pkexec isn't working as expected and thus
prevents the debugger from attaching.

Without pkexec in the container vscode 'falls back' to plain old sudo
which we can run passwordless in the container.

For pkexec to be removed we need to first purge
software-propertied-common as well as autoremove all packages that were
installed due to the installation of said package. By performing this
all in one step we minimize the size of the layer we are creating.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devcontainer Optimizations against the development container
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants