-
-
Notifications
You must be signed in to change notification settings - Fork 36
Publish dockerfile #30
base: develop
Are you sure you want to change the base?
Conversation
This causes the container build process to execute each of the programs, querying the version of each program. If any program cannot report its version, the build process fails.
Users that need a CLI code editor can add it back in themselves. Users that are using the Dockerfile to build and deploy code can add their project themselves.
Codecov Report
@@ Coverage Diff @@
## main #30 +/- ##
=======================================
Coverage 77.77% 77.77%
=======================================
Files 3 3
Lines 36 36
Branches 19 19
=======================================
Hits 28 28
Misses 7 7
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
|
To make this work, some settings will need to be changed. This process is partially described in https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry.
After these settings are changed, cpp_boilerplate_project will be linked to the packages that this workflow generates. You can see what that would look like here, on my personal fork of cpp_boilerplate_project: https://github.com/ddalcino/cpp_boilerplate_project/pkgs/container/cpp. |
Co-authored-by: Iason Nikolas <[email protected]>
Co-authored-by: Iason Nikolas <[email protected]>
0ae68b9 to
5db36c9
Compare
I am planning on doing something like this, but I'm not sure about the names. I want to follow established naming/versioning conventions, but I'm not certain what they are. Is a Oh, and thanks for the feedback! It's very useful. |
I haven't looked at it yet, but the state of USE_ROOT sounds like a very useful thing to add to the container tag.
I think it definitely makes sense to remove USE_CLANG from the parent
Have you looked into Github self-hosted runners? It sounds like that's what you are describing. I'm not too certain though; I have never used them. The only real way for the Docker container to truly mirror the GH workflow CI environment would be to run this Docker container in CI. We can get close to the CI environments by removing most of the Docker container and replacing it with setup-cpp, the same tool we use to install most of our packages in CI, but there would always be differences. There are a few things that our container can do that setup-cpp cannot, for instance, install |
| with: | ||
| file: ./docker/Dockerfile | ||
| context: ./docker | ||
| push: ${{ github.ref == 'refs/heads/main' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is insufficient. What we need here is to check that:
- we are on the main branch
- there isn't already an existing container in our package repository that has the same tag, that a push would mistakenly overwrite. We don't want to overwrite an existing
cpp-gcc11-llvm-13:0.1.1when we have forgotten to bump the version to0.1.2; there may not be a way to get the original back.
If both these conditions are true, it should be safe to push a new version of the container.
I'm not so experienced with GH workflow syntax, and I'm not clear on how to make this check work. Honestly, I'm not even sure if ${{ github.ref == 'refs/heads/main' }} does what it looks like it does.
This separates
.devcontainer/Dockerfileinto dependent and dependee Dockerfiles. One Dockerfile will be built and published in the Github Container Repository during a CI workflow. The Dockerfile that remains in the.devcontainerfolder will depend on this published container.This will:
Fix cpp-best-practices/gui_starter_template#210
Uses two commits from #8