Skip to content

Default dev container configs for quickly adding dev container support to a new project.

License

Notifications You must be signed in to change notification settings

joshbuker/dev-containers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dev-containers

Default dev container configs for quickly adding dev container support to a new project.

Available features

https://containers.dev/features

Add with:

"features": {
  "<feature_goes_here>": {
    "version": "latest"
  }
}

.env configuration

Add the following to your devcontainer.json file:

// Set the environment variables
"runArgs": ["--env-file",".env"],

Or if you're using docker-compose, add the following under app::

env_file:
  - ../.env

This will use the .env file in your project root for importing env variables.

mounting a local folder

For example, to map ~/linux on the host to /linux/kernel on the container:

// Mount ~/linux to /linux/kernel
"mounts": [
  "source=${localEnv:HOME}${localEnv:USERPROFILE}/linux,target=/linux/kernel,type=bind,consistency=cached"
],

Or map from the project root:

"mounts": [
  "source=${localWorkspaceFolder}/.config/.wrangler,target=/home/node/.config/.wrangler,type=bind,consistency=cached"
],

Install an apt dependency

Some applications may require a dependency such as imagemagick. Add the following to the Dockerfile, replacing imagemagick with your required dependencies:

RUN apt-get update && apt-get install -y imagemagick

About

Default dev container configs for quickly adding dev container support to a new project.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published