-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add a devcontainer configuration #7583
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4b7cc4c
Add a devcontainer configuration
olix0r eda45ae
Add libssl-dev to dockerfile (for rust controllers)
olix0r a1855cf
bump container version
olix0r dc50e87
Provide a pre-installed markdowlint
olix0r 6a34874
sort packages
olix0r ce7088a
more paranoia
olix0r File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
FROM docker.io/golang:1.17-bullseye | ||
|
||
ARG USER=code | ||
ARG USER_UID=1000 | ||
ARG USER_GID=1000 | ||
|
||
# Note: we do *not* delete the apt cache so subsequent steps (like docker, | ||
# dotfiles) need not pull the cache again. This comes at the cost of a fatter | ||
# container image. | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN apt update | ||
RUN apt install -y \ | ||
clang \ | ||
cmake \ | ||
libssl-dev \ | ||
lsb-release \ | ||
lldb \ | ||
npm \ | ||
sudo \ | ||
time | ||
RUN curl -Lo /usr/local/bin/kubectl "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" \ | ||
&& chmod 755 /usr/local/bin/kubectl | ||
RUN curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash | ||
|
||
RUN npm install markdownlint-cli@0.23.1 --global | ||
|
||
RUN groupadd --gid=$USER_GID $USER \ | ||
&& useradd --uid=$USER_UID --gid=$USER_GID -m $USER \ | ||
&& echo "$USER ALL=(root) NOPASSWD:ALL" >/etc/sudoers.d/$USER \ | ||
&& chmod 0440 /etc/sudoers.d/$USER | ||
|
||
# Install a Docker client that uses the host's Docker daemon | ||
ARG USE_MOBY=false | ||
ENV DOCKER_BUILDKIT=1 | ||
RUN curl -vsL https://raw.githubusercontent.com/microsoft/vscode-dev-containers/main/script-library/docker-debian.sh \ | ||
| bash -s -- true /var/run/docker-host.sock /var/run/docker.sock "${USER}" "${USE_MOBY}" latest | ||
|
||
RUN (echo "LC_ALL=en_US.UTF-8" \ | ||
&& echo "LANGUAGE=en_US.UTF-8") >/etc/default/locale | ||
|
||
USER $USER | ||
ENV USER=$USER | ||
ENV HOME=/home/$USER | ||
RUN mkdir -p $HOME/bin | ||
|
||
RUN curl --proto '=https' --tlsv1.3 -sSf https://sh.rustup.rs \ | ||
| sh -s -- -y --default-toolchain 1.56.1 -c rustfmt -c clippy -c rls | ||
|
||
RUN mkdir /tmp/cargo-deny && cd /tmp/cargo-deny && \ | ||
curl -vsL https://github.com/EmbarkStudios/cargo-deny/releases/download/0.11.0/cargo-deny-0.11.0-x86_64-unknown-linux-musl.tar.gz | tar zxf - && \ | ||
mv cargo-deny-0.11.0-x86_64-unknown-linux-musl/cargo-deny $HOME/bin && \ | ||
cd .. && rm -rf /tmp/cargo-deny | ||
|
||
RUN curl -sL https://run.linkerd.io/install-edge | sh \ | ||
&& ln -s $(readlink ~/.linkerd2/bin/linkerd) ~/bin/linkerd | ||
|
||
ENTRYPOINT ["/usr/local/share/docker-init.sh"] | ||
CMD ["sleep", "infinity"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# devcontainer | ||
|
||
This directory provides a _devcontainer_ configuration that configures a | ||
reproducible development environment for this project. | ||
|
||
## Docker | ||
|
||
This configuration currently uses the parent host's Docker daemon (rather than | ||
running a separate docker daemon within in the container). It creates | ||
devcontainers on the host network so it's easy to use k3d clusters hosted in the | ||
parent host's docker daemon. | ||
|
||
## Customizing | ||
|
||
This configuration is supposed to provide a minimal setup without catering to | ||
any one developer's personal tastes. Devcontainers can be extended with per-user | ||
configuration. | ||
|
||
To add your own extensions to the devcontainer, configure default extensions in | ||
your VS Code settings: | ||
|
||
```jsonc | ||
"remote.containers.defaultExtensions": [ | ||
"eamodio.gitlens", | ||
"GitHub.copilot", | ||
"GitHub.vscode-pull-request-github", | ||
"mutantdino.resourcemonitor", | ||
"stateful.edge" | ||
], | ||
``` | ||
|
||
Furthermore, you can configure a _dotfiles_ repository to perform customizations | ||
with a configuration like: | ||
|
||
```jsonc | ||
"dotfiles.repository": "https://github.com/olix0r/dotfiles.git", | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"name": "linkerd2", | ||
"image": "ghcr.io/linkerd/dev:v3", | ||
// "dockerFile": "./Dockerfile", | ||
// "build": { | ||
// "args": { | ||
// "USER": "code", | ||
// //"USER_UID": "${localEnv:UID}", | ||
// //"USER_GID": "${localEnv:GID}" | ||
// }, | ||
// }, | ||
"settings": {}, | ||
"extensions": [ | ||
"DavidAnson.vscode-markdownlint", | ||
"matklad.rust-analyzer", | ||
"NathanRidley.autotrim", | ||
"samverschueren.final-newline", | ||
"streetsidesoftware.code-spell-checker", | ||
"tamasfe.even-better-toml", | ||
"vadimcn.vscode-lldb", | ||
"zxh404.vscode-proto3" | ||
], | ||
"runArgs": [ | ||
"--init", | ||
// Use the host network so we can access k3d, etc. | ||
"--net=host", | ||
// For lldb | ||
"--cap-add=SYS_PTRACE", | ||
"--security-opt=seccomp=unconfined" | ||
], | ||
"overrideCommand": false, | ||
"remoteUser": "code", | ||
"mounts": [ | ||
"source=/var/run/docker.sock,target=/var/run/docker-host.sock,type=bind" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.56.0 | ||
1.56.1 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 updated this script to be able to use a globally installed
markdownlint