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

Added development container #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

rovo89
Copy link

@rovo89 rovo89 commented Jan 14, 2025

This makes development more comfortable because the build intermediates (e.g. the generated bases classes for services) are available and VSCode can make full use of the CMake integration.

The Dockerfile for the development container has various improvements over the original one (which is still kept for CI and might be adjusted later):

  • Non-root user added which will automatically be updated to the current user's UID and GID. It has sudo permissions in case we want to install some further packages temporarily.

  • The "apt-get" command is run with cache mounts as recommended here: https://docs.docker.com/build/cache/optimize/#use-cache-mounts This speeds up the build if only a few new packages are added, because previously downloaded packages can be used from the cache. Obviously, this won't work if the cache is cleared.

  • "--no-install-recommends" is used to avoid installing more than 100 unnecessary packages. A few requirements are explicitly listed to ensure that the build still works. Otherwise e.g. include like "math.h" and "" are missing and there is a message "plugin needed to handle lto object".

The "build-binary.sh" script is adjusted to run within the development container. It now takes an optional argument to specify the preset (it defaults to "Release" as before).

This makes development more comfortable because the build intermediates
(e.g. the generated bases classes for services) are available and VSCode
can make full use of the CMake integration.

The Dockerfile for the development container has various improvements
over the original one (which is still kept for CI and might be adjusted
later):

- Non-root user added which will automatically be updated to the current
  user's UID and GID. It has sudo permissions in case we want to install
  some further packages temporarily.

- The "apt-get" command is run with cache mounts as recommended here:
    https://docs.docker.com/build/cache/optimize/#use-cache-mounts
  This speeds up the build if only a few new packages are added, because
  previously downloaded packages can be used from the cache. Obviously,
  this won't work if the cache is cleared.

- "--no-install-recommends" is used to avoid installing more than
  100 unnecessary packages. A few requirements are explicitly listed to
  ensure that the build still works. Otherwise e.g. include like
  "math.h" and "<cstdio>" are missing and there is a message
  "plugin needed to handle lto object".

The "build-binary.sh" script is adjusted to run within the development
container. It now takes an optional argument to specify the preset (it
defaults to "Release" as before).
@CLAassistant
Copy link

CLAassistant commented Jan 14, 2025

CLA assistant check
All committers have signed the CLA.

@rovo89
Copy link
Author

rovo89 commented Jan 18, 2025

I added a debug config, but didn't see that @Apehaenger send me a PR for a different variant before: rovo89#1
Will need to compare...

@rovo89
Copy link
Author

rovo89 commented Jan 23, 2025

@ClemensElflein Now this PR is ready to merge. @Apehaenger went back and forth a lot on it😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants