-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
docker: introduce devcontainers #2282
base: master
Are you sure you want to change the base?
Conversation
The title of this PR doesn't match its content. It's in fact two PRs -- one that introduces devcontainers, and another one that cleans existing scripts and dockerfile. Please, split |
@@ -0,0 +1,10 @@ | |||
{ |
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.
Some intro for those who never used devcontainers in the patch comment would be helpful
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.
And why it's good for us.
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.
And how to build and use it.
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.
I've added instructions and hopefully this patch will help developers simplify their development process
.devcontainer/Dockerfile
Outdated
COPY install-dependencies.sh /tmp/ | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
RUN --mount=type=bind,source=./install-dependencies.sh,target=./install-dependencies.sh \ |
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.
The patch comment lacks motivation of this change
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.
I thought it reduces layers - since we do not copy the file over to the container.
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.
I thought it reduces layers - since we do not copy the file over to the container.
yep, it's right
docker/dev/Dockerfile
Outdated
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
CMD ["/bin/bash"] |
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.
nit: This change is missing in (already laconic enough) patch comment
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.
I found it with hadolint. it helps to pass OS signals to executable in a correct way (https://github.com/hadolint/hadolint/wiki/DL3025#rationale)
I've commented about it in a new one PR
it allows you to use a container as a full-featured development environment. you can open project with IDE (clion, vscode, visual studio) inside a container in a convenient way: https://containers.dev/supporting .devcontainer/devcontainer.json contains metadata and settings for devcontainer configuration: https://containers.dev/implementors/json_reference/ Signed-off-by: pavelbezpravel <[email protected]>
Signed-off-by: pavelbezpravel <[email protected]>
617eef3
to
9bfff81
Compare
ebf6a89
to
6ea987c
Compare
introduce devcontainers as a yet another way to build project
it allows you to build project with docker containers in a convenient way with IDE or cli