Browse Source

devcontainer: experimental harvey codespace support

sevki 3 years ago
parent
commit
1c51de0446
2 changed files with 42 additions and 0 deletions
  1. 12 0
      .devcontainer/Dockerfile
  2. 30 0
      .devcontainer/devcontainer.json

+ 12 - 0
.devcontainer/Dockerfile

@@ -0,0 +1,12 @@
+FROM alpine:latest
+
+RUN apk update; apk add git git-perl go gcc bison musl-dev qemu qemu-system-x86_64 curl bash
+ENV HARVEY=/harvey ARCH=amd64 CC=gcc
+RUN adduser -S harvey && adduser -S none
+
+ADD . /harvey
+WORKDIR /harvey
+
+RUN ./bootstrap.sh && /harvey/util/build
+
+ENTRYPOINT ["/harvey/util/GO9PCPUDOCKER"]

+ 30 - 0
.devcontainer/devcontainer.json

@@ -0,0 +1,30 @@
+{
+    "name": "Harvey",
+    "build": {
+        "dockerfile": "Dockerfile",
+        // Update the VARIANT arg to pick a version of Go
+        "args": { "VARIANT": "1" }
+    },
+    "runArgs": ["--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined"],
+
+    // Set *default* container specific settings.json values on container create.
+    "settings": {
+        "terminal.integrated.shell.linux": "/bin/bash",
+        "go.gopath": "/go"
+    },
+
+    // Add the IDs of extensions you want installed when the container is created.
+    "extensions": [
+        "golang.Go",
+        "ms-vscode.cpptools"
+    ]
+
+    // 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": "go version",
+
+    // Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
+    // "remoteUser": "vscode"
+}