Skip to content

Commit

Permalink
fix(vscode/devcontainer): unexpected exit stdout /etc/passwd
Browse files Browse the repository at this point in the history
1. Moved away from trying to handroll an Ubuntu-22.04 image for the dev container
and instead used the "features" feature (no pun intended) of the dev container
spec: https://code.visualstudio.com/blogs/2022/09/15/dev-container-features
2. This produces a container that builds and launches reliably without the
issues the previous version was suffering from (which was that to some people
the container would just exit randomly during the launch)
3. Our future goal of having the dev container being built in a reproducible
way is still not achieved, but we've gotten closer because in the meantime
while working on this issue it was discovered that we can re-build the images
directly from the CLI by using the dev container CLI package:
https://github.com/devcontainers/cli
4. The upside of not building the image from scratch is that we can count on
future improvements/maintenance from others who are working on these images.
5. The downside of not building the image from scratch is that if we end up
finding something that does not work due to the customizations, it might be
more difficult to figure that out compared to if we had just build our own.
6. It is hard to predcit right now whether 4) or 5) will end up being having
the stronger effect, but we can cross that bridge when we get to it.
7. In the meantime I've started working on a contribution to the dev container
CLI itself for a dockerfile ejection feature (meaning that we'll be able to
render a single Dockerfile for the dev container (that right now the CLI only
stores/uses internally in it's own code at runtime). This eject feature will
be good for debugging purposes in case anything goes wrong with the image in the
future.
8. Also added a publishing workflow action that will build the dev container
image on the main branch when there is a release tag (v*) issued.

Fixes #2404

Signed-off-by: Peter Somogyvari <[email protected]>
  • Loading branch information
petermetz committed Jun 16, 2023
1 parent 48e39bf commit eb0134b
Show file tree
Hide file tree
Showing 8 changed files with 138 additions and 755 deletions.
87 changes: 0 additions & 87 deletions .devcontainer/Dockerfile

This file was deleted.

42 changes: 0 additions & 42 deletions .devcontainer/README.md

This file was deleted.

94 changes: 64 additions & 30 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,73 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.166.1/containers/docker-in-docker
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "Ubuntu 20.04 - Docker in Docker",
"dockerFile": "Dockerfile",
"runArgs": ["--init", "--privileged"],
"overrideCommand": false,
"name": "Ubuntu",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"runArgs": ["--network=host"],
"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
"moby": true,
"installDockerBuildx": true,
"version": "20.10.24",
"dockerDashComposeVersion": "v2"
},
"ghcr.io/devcontainers/features/git:1": {
"ppa": true,
"version": "2.40.1"
},
"ghcr.io/devcontainers/features/go:1": {
"version": "1.20.4"
},
"ghcr.io/devcontainers/features/java:1": {
"installGradle": true,
"installMaven": false,
"installAnt": false,
"version": "11.0.12-open",
"jdkDistro": "open",
"gradleVersion": "7.5.1",
"mavenVersion": "3.8.6",
"antVersion": "1.10.12"
},
"ghcr.io/devcontainers/features/node:1": {
"nodeGypDependencies": true,
"version": "18.16.0"
},
"ghcr.io/devcontainers/features/rust:1": {
"version": "1.63",
"profile": "complete"
},
"ghcr.io/devcontainers-contrib/features/actions-runner:1": {
"version": "latest",
"dotnetVersion": "latest"
},
"ghcr.io/devcontainers-contrib/features/curl-apt-get:1": {},
"ghcr.io/devcontainers-contrib/features/dive:1": {
"version": "v0.10.0"
},
"ghcr.io/devcontainers-contrib/features/gitmux:1": {
"version": "v0.10.2"
},
"ghcr.io/devcontainers-contrib/features/ionic-cli:2": {
"version": "7.1.1"
},
"ghcr.io/devcontainers-contrib/features/kind:1": {
"version": "v0.18.0"
}
}

// Use this environment variable if you need to bind mount your local source code into a new container.
// Set *default* container specific settings.json values on container create.
"settings": {
// "terminal.integrated.shell.linux": "/bin/bash",
"terminal.integrated.rendererType": "auto"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"bierner.markdown-mermaid",
"ms-azuretools.vscode-docker",
"mhutchie.git-graph",
"alefragnani.bookmarks",
"yzhang.markdown-all-in-one",
"trabpukcip.vscode-npm-scripts",
"jebbs.plantuml",
"ms-vscode-remote.vscode-remote-extensionpack",
"juanblanco.solidity",
"dbaeumer.vscode-eslint",
"42crunch.vscode-openapi"
],
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "bash -i -c '~/bin/post-create-commands.sh'",
// "postCreateCommand": "uname -a",

// Configure tool-specific properties.
// "customizations": {},

// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
Loading

0 comments on commit eb0134b

Please sign in to comment.