Skip to content

Commit

Permalink
Add devcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
markpollack committed Aug 20, 2023
1 parent e9a6ae7 commit f1bd67b
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/ubuntu/.devcontainer/base.Dockerfile

# [Choice] Ubuntu version (use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon): ubuntu-22.04, ubuntu-20.04, ubuntu-18.04
ARG VARIANT="jammy"
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends direnv


36 changes: 36 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// 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.245.2/containers/ubuntu
{
"name": "acme-fitness-store",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04
// Use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon.
"args": {
"VARIANT": "ubuntu-22.04"
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
"onCreateCommand": "./.devcontainer/scripts/onCreateCommand.sh",
// Use 'postCreateCommand' to run commands after the container is created.
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
"hostRequirements": {
"cpus": 2
},
"containerEnv": {
"GRADLE_USER_HOME": "/home/vscode", // required because the java feature is not setting this correctly
"M2": "/home/vscode" // required because the java feature is not setting this correctly
},
"features": {
"azure-cli": "latest",
"docker-from-docker": "latest",
"node": "lts",
"ghcr.io/devcontainers/features/java:1": {
"version": "17",
"installGradle": true,
"installMaven": true
}
}
}
6 changes: 6 additions & 0 deletions .devcontainer/scripts/onCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

set -x

az extension add --name spring

0 comments on commit f1bd67b

Please sign in to comment.