From a54623c93be762add23e0700c115a9d1821094a0 Mon Sep 17 00:00:00 2001 From: thomas Date: Tue, 21 Jan 2020 12:49:27 -0500 Subject: [PATCH 1/7] Executables loaded --- .../hashistack/.devcontainer/Dockerfile | 134 ++++++++++++++++++ .../.devcontainer/devcontainer.json | 31 ++++ containers/hashistack/.npmignore | 5 + containers/hashistack/README.md | 49 +++++++ containers/hashistack/definition-build.json | 25 ++++ containers/hashistack/test-project/test.sh | 56 ++++++++ 6 files changed, 300 insertions(+) create mode 100644 containers/hashistack/.devcontainer/Dockerfile create mode 100644 containers/hashistack/.devcontainer/devcontainer.json create mode 100644 containers/hashistack/.npmignore create mode 100644 containers/hashistack/README.md create mode 100644 containers/hashistack/definition-build.json create mode 100755 containers/hashistack/test-project/test.sh diff --git a/containers/hashistack/.devcontainer/Dockerfile b/containers/hashistack/.devcontainer/Dockerfile new file mode 100644 index 0000000000..bbde4720f6 --- /dev/null +++ b/containers/hashistack/.devcontainer/Dockerfile @@ -0,0 +1,134 @@ +#------------------------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. +#------------------------------------------------------------------------------------------------------------- +FROM ubuntu:18.04 + +# This Dockerfile adds a non-root user with sudo access. Use the "remoteUser" +# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs +# will be updated to match your local UID/GID (when using the dockerFile property). +# See https://aka.ms/vscode-remote/containers/non-root-user for details. +ARG USERNAME=vscode +ARG USER_UID=1000 +ARG USER_GID=$USER_UID + +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive + +ARG COMPOSE_VERSION=1.24.0 +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \ + # + # Verify git, zsh, process tools installed + && apt-get -y install git iproute2 procps zsh unzip \ + # + # Install Docker CE CLI + && apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common lsb-release \ + && curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | (OUT=$(apt-key add - 2>&1) || echo $OUT) \ + && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \ + && apt-get update \ + && apt-get install -y docker-ce-cli \ + # + # Install Docker Compose + && curl -sSL "https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \ + && chmod +x /usr/local/bin/docker-compose \ + # + # Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user. + && groupadd --gid $USER_GID $USERNAME \ + && useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \ + # [Optional] Add sudo support for the non-root user + && apt-get install -y sudo \ + && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\ + && chmod 0440 /etc/sudoers.d/$USERNAME \ + # + # Clean up + && apt-get autoremove -y \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* + +# Switch back to dialog for any ad-hoc use of apt-get +# TODO: Move this down once everything settles. +ENV DEBIAN_FRONTEND=dialog + +# Hashicorp. +WORKDIR /ops + +## Consul +ARG CONSULVERSION=1.6.0 +ARG CONSULDOWNLOAD=https://releases.hashicorp.com/consul/${CONSULVERSION}/consul_${CONSULVERSION}_linux_amd64.zip +ARG CONSULCONFIGDIR=/etc/consul.d +ARG CONSULDIR=/opt/consul + +### Download +RUN curl -L $CONSULDOWNLOAD > consul.zip + +### Install +RUN unzip consul.zip -d /usr/local/bin +RUN chmod 0755 /usr/local/bin/consul +RUN chown root:root /usr/local/bin/consul + +### Configure +RUN mkdir -p $CONSULCONFIGDIR +RUN chmod 755 $CONSULCONFIGDIR +RUN mkdir -p $CONSULDIR +RUN chmod 755 $CONSULDIR + +## Consul Template +ARG CONSULTEMPLATEVERSION=0.20.0 +ARG CONSULTEMPLATEDOWNLOAD=https://releases.hashicorp.com/consul-template/${CONSULTEMPLATEVERSION}/consul-template_${CONSULTEMPLATEVERSION}_linux_amd64.zip +ARG CONSULTEMPLATECONFIGDIR=/etc/consul-template.d +ARG CONSULTEMPLATEDIR=/opt/consul-template + +### Download +RUN curl -L $CONSULTEMPLATEDOWNLOAD > consul-template.zip + +## Install +RUN unzip consul-template.zip -d /usr/local/bin +RUN chmod 0755 /usr/local/bin/consul-template +RUN chown root:root /usr/local/bin/consul-template + +## Configure +RUN mkdir -p $CONSULTEMPLATECONFIGDIR +RUN chmod 755 $CONSULTEMPLATECONFIGDIR +RUN mkdir -p $CONSULTEMPLATEDIR +RUN chmod 755 $CONSULTEMPLATEDIR + +## Vault +ARG VAULTVERSION=1.0.3 +ARG VAULTDOWNLOAD=https://releases.hashicorp.com/vault/${VAULTVERSION}/vault_${VAULTVERSION}_linux_amd64.zip +ARG VAULTCONFIGDIR=/etc/vault.d +ARG VAULTDIR=/opt/vault + +### Download +RUN curl -L $VAULTDOWNLOAD > vault.zip + +### Install +RUN unzip vault.zip -d /usr/local/bin +RUN chmod 0755 /usr/local/bin/vault +RUN chown root:root /usr/local/bin/vault + +### Configure +RUN mkdir -p $VAULTCONFIGDIR +RUN chmod 755 $VAULTCONFIGDIR +RUN mkdir -p $VAULTDIR +RUN chmod 755 $VAULTDIR + +## Nomad +ARG NOMADVERSION=0.9.0 +ARG NOMADDOWNLOAD=https://releases.hashicorp.com/nomad/${NOMADVERSION}/nomad_${NOMADVERSION}_linux_amd64.zip +ARG NOMADCONFIGDIR=/etc/nomad.d +ARG NOMADDIR=/opt/nomad + +### Download +RUN curl -L $NOMADDOWNLOAD > nomad.zip + +### Install +RUN unzip nomad.zip -d /usr/local/bin +RUN chmod 0755 /usr/local/bin/nomad +RUN chown root:root /usr/local/bin/nomad + +### Configure +RUN mkdir -p $NOMADCONFIGDIR +RUN chmod 755 $NOMADCONFIGDIR +RUN mkdir -p $NOMADDIR +RUN chmod 755 $NOMADDIR diff --git a/containers/hashistack/.devcontainer/devcontainer.json b/containers/hashistack/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..bda016d493 --- /dev/null +++ b/containers/hashistack/.devcontainer/devcontainer.json @@ -0,0 +1,31 @@ +{ + "name": "HashiStack", + "dockerFile": "Dockerfile", + + // Use 'settings' to set *default* container specific settings.json values on container create. + // You can edit these settings after create using File > Preferences > Settings > Remote. + "settings": { + "terminal.integrated.shell.linux": "/bin/zsh" + }, + + // Use 'appPort' to create a container with published ports. If the port isn't working, be sure + // your server accepts connections from all interfaces (0.0.0.0 or '*'), not just localhost. + // "appPort": [], + + // Uncomment the next line to run commands after the container is created. + // "postCreateCommand": "uname -a", + + // Uncomment the next line to use Docker from inside the container. See https://aka.ms/vscode-remote/samples/docker-in-docker for details. + "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ], + + // Uncomment the next line if you will use a ptrace-based debugger like C++, Go, and Rust + // "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ], + + // Uncomment the next line to have VS Code connect as an existing non-root user in the container. + // On Linux, by default, the container user's UID/GID will be updated to match your local user. See + // https://aka.ms/vscode-remote/containers/non-root for details on adding a non-root user if none exist. + // "remoteUser": "vscode", + + // Add the IDs of extensions you want installed when the container is created in the array below. + "extensions": ["wholroyd.hcl"] +} \ No newline at end of file diff --git a/containers/hashistack/.npmignore b/containers/hashistack/.npmignore new file mode 100644 index 0000000000..f5e67ff263 --- /dev/null +++ b/containers/hashistack/.npmignore @@ -0,0 +1,5 @@ +README.md +test-project +definition-build.json +.vscode +.npmignore diff --git a/containers/hashistack/README.md b/containers/hashistack/README.md new file mode 100644 index 0000000000..7968f1cd9b --- /dev/null +++ b/containers/hashistack/README.md @@ -0,0 +1,49 @@ +# HashiStack + +## Summary + +*Simple container with Nomad, Consul, and Vault* + +| Metadata | Value | +| ---------------------- | ------------------------------------------------------------ | +| *Contributors* | The VS Code Team, [@thoward27](https://github.com/thoward27) | +| *Definition type* | Dockerfile | +| *Published image* | TODO | +| *Languages, platforms* | Any | + +## Using this definition with an existing folder + +This definition does not require any special steps to use. Just follow these steps: + +1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine. + +2. To use VS Code's copy of this definition: + 1. Start VS Code and open your project folder. + 2. Press F1 select and **Remote-Containers: Add Development Container Configuration Files...** from the command palette. + 3. Select the Ubuntu 18.04 & Git definition. + +3. To use latest-and-greatest copy of this definition from the repository: + 1. Clone this repository. + 2. Copy the contents of `containers/ubuntu-18.04-git/.devcontainer` to the root of your project folder. + 3. Start VS Code and open your project folder. + +4. After following step 2 or 3, the contents of the `.devcontainer` folder in your project can be adapted to meet your needs. + +5. Finally, press F1 and run **Remote-Containers: Reopen Folder in Container** to start using the definition. + +## Testing the definition + +This definition includes some test code that will help you verify it is working as expected on your system. Follow these steps: + +1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine. +2. Clone this repository. +3. Start VS Code, press F1, and select **Remote-Containers: Open Folder in Container...** +4. Select the `containers/ubuntu-18.04-git` folder. +5. Press ctrl+shift+\` and type the following command to verify installation: `apt-get update && apt-get install -y lsb-release && git --version && lsb_release -a` +6. After lsb_release installs, you should see the Git version and details about the version of Linux in the container. + +## License + +Copyright (c) Microsoft Corporation. All rights reserved. + +Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE) diff --git a/containers/hashistack/definition-build.json b/containers/hashistack/definition-build.json new file mode 100644 index 0000000000..3c0ab78be8 --- /dev/null +++ b/containers/hashistack/definition-build.json @@ -0,0 +1,25 @@ +{ + "build": { + "rootDistro": "debian", + "tags": [ + "base:${VERSION}-ubuntu-18.04", + "base:${VERSION}-bionic" + ] + }, + "dependencies": { + "image": "ubuntu:18.04", + "imageLink": "https://hub.docker.com/_/ubuntu", + "manual": [ + { + "Component": { + "Type": "git", + "git": { + "Name": "Oh My Zsh!", + "repositoryUrl": "https://github.com/robbyrussell/oh-my-zsh", + "commitHash": "c130aadb6a66aa680a322c08d87ad773316f713d" + } + } + } + ] + } +} diff --git a/containers/hashistack/test-project/test.sh b/containers/hashistack/test-project/test.sh new file mode 100755 index 0000000000..c1e7f63f95 --- /dev/null +++ b/containers/hashistack/test-project/test.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env bash +cd $(dirname "$0") + +if [ -z $HOME ]; then + HOME="/root" +fi + +FAILED=() + +check() { + LABEL=$1 + shift + echo -e "\n๐Ÿงช Testing $LABEL: $@" + if $@; then + echo "๐Ÿ† Passed!" + else + echo "๐Ÿ’ฅ $LABEL check failed." + FAILED+=("$LABEL") + fi +} + +checkMultiple() { + PASSED=0 + LABEL="$1" + shift; MINIMUMPASSED=$1 + shift; EXPRESSION="$1" + while [ "$EXPRESSION" != "" ]; do + if $EXPRESSION; then ((PASSED++)); fi + shift; EXPRESSION=$1 + done + check "$LABEL" [ $PASSED -ge $MINIMUMPASSED ] +} + +checkExtension() { + checkMultiple "$1" 1 "[ -d ""$HOME/.vscode-server/extensions/$1*"" ]" "[ -d ""$HOME/.vscode-server-insiders/extensions/$1*"" ]" "[ -d ""$HOME/.vscode-test-server/extensions/$1*"" ]" +} + +# Actual tests +checkMultiple "vscode-server" 1 "[ -d ""$HOME/.vscode-server/bin"" ]" "[ -d ""$HOME/.vscode-server-insiders/bin"" ]" "[ -d ""$HOME/.vscode-test-server/bin"" ]" +check "non-root-user" "id vscode" +check "/home/vscode" [ -d "/home/vscode" ] +check "sudo" sudo -u vscode echo "sudo works." +check "git" git --version +check "command-line-tools" which top ip lsb_release +check "nomad" nomad -v +check "consul" consul -v +check "vault" vault -v + +# Report result +if [ ${#FAILED[@]} -ne 0 ]; then + echo -e "\n๐Ÿ’ฅ Failed tests: ${FAILED[@]}" + exit 1 +else + echo -e "\n๐Ÿ’ฏ All passed!" + exit 0 +fi From 441be9831b5b1823ffbb598cae3ec1cb535e00e1 Mon Sep 17 00:00:00 2001 From: thomas Date: Tue, 21 Jan 2020 20:51:34 +0000 Subject: [PATCH 2/7] Tweaking versions --- .../hashistack/.devcontainer/Dockerfile | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/containers/hashistack/.devcontainer/Dockerfile b/containers/hashistack/.devcontainer/Dockerfile index bbde4720f6..c7a464b27b 100644 --- a/containers/hashistack/.devcontainer/Dockerfile +++ b/containers/hashistack/.devcontainer/Dockerfile @@ -12,10 +12,12 @@ ARG USERNAME=vscode ARG USER_UID=1000 ARG USER_GID=$USER_UID +# Docker Compose. +ARG COMPOSE_VERSION=1.24.0 + # Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive -ARG COMPOSE_VERSION=1.24.0 RUN apt-get update \ && apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \ # @@ -54,8 +56,8 @@ ENV DEBIAN_FRONTEND=dialog WORKDIR /ops ## Consul -ARG CONSULVERSION=1.6.0 -ARG CONSULDOWNLOAD=https://releases.hashicorp.com/consul/${CONSULVERSION}/consul_${CONSULVERSION}_linux_amd64.zip +ARG CONSUL_VERSION=1.6.1 +ARG CONSULDOWNLOAD=https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_amd64.zip ARG CONSULCONFIGDIR=/etc/consul.d ARG CONSULDIR=/opt/consul @@ -74,8 +76,8 @@ RUN mkdir -p $CONSULDIR RUN chmod 755 $CONSULDIR ## Consul Template -ARG CONSULTEMPLATEVERSION=0.20.0 -ARG CONSULTEMPLATEDOWNLOAD=https://releases.hashicorp.com/consul-template/${CONSULTEMPLATEVERSION}/consul-template_${CONSULTEMPLATEVERSION}_linux_amd64.zip +ARG CONSUL_TEMPLATE_VERSION=0.20.0 +ARG CONSULTEMPLATEDOWNLOAD=https://releases.hashicorp.com/consul-template/${CONSUL_TEMPLATE_VERSION}/consul-template_${CONSUL_TEMPLATE_VERSION}_linux_amd64.zip ARG CONSULTEMPLATECONFIGDIR=/etc/consul-template.d ARG CONSULTEMPLATEDIR=/opt/consul-template @@ -94,8 +96,8 @@ RUN mkdir -p $CONSULTEMPLATEDIR RUN chmod 755 $CONSULTEMPLATEDIR ## Vault -ARG VAULTVERSION=1.0.3 -ARG VAULTDOWNLOAD=https://releases.hashicorp.com/vault/${VAULTVERSION}/vault_${VAULTVERSION}_linux_amd64.zip +ARG VAULT_VERSION=1.3.1 +ARG VAULTDOWNLOAD=https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip ARG VAULTCONFIGDIR=/etc/vault.d ARG VAULTDIR=/opt/vault @@ -114,8 +116,8 @@ RUN mkdir -p $VAULTDIR RUN chmod 755 $VAULTDIR ## Nomad -ARG NOMADVERSION=0.9.0 -ARG NOMADDOWNLOAD=https://releases.hashicorp.com/nomad/${NOMADVERSION}/nomad_${NOMADVERSION}_linux_amd64.zip +ARG NOMAD_VERSION=0.10.2 +ARG NOMADDOWNLOAD=https://releases.hashicorp.com/nomad/${NOMAD_VERSION}/nomad_${NOMAD_VERSION}_linux_amd64.zip ARG NOMADCONFIGDIR=/etc/nomad.d ARG NOMADDIR=/opt/nomad From 1a86466cc77ac33bbf2ca4babe11489063a3b55d Mon Sep 17 00:00:00 2001 From: thomas Date: Tue, 21 Jan 2020 20:51:48 +0000 Subject: [PATCH 3/7] Exposing nomad port --- containers/hashistack/.devcontainer/devcontainer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/containers/hashistack/.devcontainer/devcontainer.json b/containers/hashistack/.devcontainer/devcontainer.json index bda016d493..b32e635744 100644 --- a/containers/hashistack/.devcontainer/devcontainer.json +++ b/containers/hashistack/.devcontainer/devcontainer.json @@ -10,7 +10,8 @@ // Use 'appPort' to create a container with published ports. If the port isn't working, be sure // your server accepts connections from all interfaces (0.0.0.0 or '*'), not just localhost. - // "appPort": [], + // 4846: nomad; + "appPort": [4846], // Uncomment the next line to run commands after the container is created. // "postCreateCommand": "uname -a", From 7e94ce4a0a88d5ffc02d540e68eeaf2cd9c7e395 Mon Sep 17 00:00:00 2001 From: thomas Date: Thu, 23 Jan 2020 15:52:57 +0000 Subject: [PATCH 4/7] fix: can now add keys to vault --- containers/hashistack/.devcontainer/Dockerfile | 8 ++++++-- containers/hashistack/.devcontainer/devcontainer.json | 6 +++--- containers/hashistack/.gitignore | 1 + containers/hashistack/up.sh | 8 ++++++++ 4 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 containers/hashistack/.gitignore create mode 100644 containers/hashistack/up.sh diff --git a/containers/hashistack/.devcontainer/Dockerfile b/containers/hashistack/.devcontainer/Dockerfile index c7a464b27b..503aae3b0c 100644 --- a/containers/hashistack/.devcontainer/Dockerfile +++ b/containers/hashistack/.devcontainer/Dockerfile @@ -21,8 +21,8 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update \ && apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \ # - # Verify git, zsh, process tools installed - && apt-get -y install git iproute2 procps zsh unzip \ + # Verify git, zsh, vim, process tools installed + && apt-get -y install git iproute2 procps zsh unzip neovim \ # # Install Docker CE CLI && apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common lsb-release \ @@ -48,6 +48,10 @@ RUN apt-get update \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* +# Oh-My-ZSH +RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" +RUN echo 'alias vim=nvim' >> ~/.zshrc + # Switch back to dialog for any ad-hoc use of apt-get # TODO: Move this down once everything settles. ENV DEBIAN_FRONTEND=dialog diff --git a/containers/hashistack/.devcontainer/devcontainer.json b/containers/hashistack/.devcontainer/devcontainer.json index b32e635744..a4f49346f9 100644 --- a/containers/hashistack/.devcontainer/devcontainer.json +++ b/containers/hashistack/.devcontainer/devcontainer.json @@ -10,8 +10,8 @@ // Use 'appPort' to create a container with published ports. If the port isn't working, be sure // your server accepts connections from all interfaces (0.0.0.0 or '*'), not just localhost. - // 4846: nomad; - "appPort": [4846], + // 4646: nomad; 8500: consul; 8200: vault; + // "appPort": [4646, 8500, 8200], // Uncomment the next line to run commands after the container is created. // "postCreateCommand": "uname -a", @@ -28,5 +28,5 @@ // "remoteUser": "vscode", // Add the IDs of extensions you want installed when the container is created in the array below. - "extensions": ["wholroyd.hcl"] + "extensions": ["wholroyd.hcl", "wakatime.vscode-wakatime"] } \ No newline at end of file diff --git a/containers/hashistack/.gitignore b/containers/hashistack/.gitignore new file mode 100644 index 0000000000..5292519a25 --- /dev/null +++ b/containers/hashistack/.gitignore @@ -0,0 +1 @@ +logs/ \ No newline at end of file diff --git a/containers/hashistack/up.sh b/containers/hashistack/up.sh new file mode 100644 index 0000000000..cdf1feab87 --- /dev/null +++ b/containers/hashistack/up.sh @@ -0,0 +1,8 @@ +set -e + +mkdir -p logs +consul agent -dev > logs/consul & +nomad agent -dev > logs/nomad & +vault server -dev > logs/vault & + +export VAULT_ADDR='http://127.0.0.1:8200' From 2b7a75f8eee5d04852b0cbd32dd91239c61f7ec8 Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 24 Jan 2020 15:09:04 +0000 Subject: [PATCH 5/7] feat: nomad jobs working --- containers/hashistack/.devcontainer/devcontainer.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/containers/hashistack/.devcontainer/devcontainer.json b/containers/hashistack/.devcontainer/devcontainer.json index a4f49346f9..e5e7906ad6 100644 --- a/containers/hashistack/.devcontainer/devcontainer.json +++ b/containers/hashistack/.devcontainer/devcontainer.json @@ -17,10 +17,11 @@ // "postCreateCommand": "uname -a", // Uncomment the next line to use Docker from inside the container. See https://aka.ms/vscode-remote/samples/docker-in-docker for details. - "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ], + "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind", "type=tmpfs,destination=/tmpfs"], - // Uncomment the next line if you will use a ptrace-based debugger like C++, Go, and Rust - // "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ], + // Add these to runArgs if you will use a ptrace-based debugger like C++, Go, and Rust + // [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ], + "runArgs": [ "--privileged"], // Uncomment the next line to have VS Code connect as an existing non-root user in the container. // On Linux, by default, the container user's UID/GID will be updated to match your local user. See @@ -28,5 +29,5 @@ // "remoteUser": "vscode", // Add the IDs of extensions you want installed when the container is created in the array below. - "extensions": ["wholroyd.hcl", "wakatime.vscode-wakatime"] + "extensions": ["wholroyd.hcl"] } \ No newline at end of file From 7c11cc54c9d971cb94ae03a7891f6582bcc3cfa8 Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 24 Jan 2020 15:17:39 +0000 Subject: [PATCH 6/7] fix: up.sh disowns processes --- containers/hashistack/up.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/containers/hashistack/up.sh b/containers/hashistack/up.sh index cdf1feab87..2c960468c1 100644 --- a/containers/hashistack/up.sh +++ b/containers/hashistack/up.sh @@ -1,8 +1,6 @@ set -e mkdir -p logs -consul agent -dev > logs/consul & -nomad agent -dev > logs/nomad & -vault server -dev > logs/vault & - -export VAULT_ADDR='http://127.0.0.1:8200' +consul agent -dev > logs/consul &! +nomad agent -dev > logs/nomad &! +vault server -dev > logs/vault &! From 0b514a4299e74585307ca9c70d1c1cc86f25ea60 Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 24 Jan 2020 15:19:37 +0000 Subject: [PATCH 7/7] fix: exporting vault address in up, then add to zshrc --- containers/hashistack/up.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/containers/hashistack/up.sh b/containers/hashistack/up.sh index 2c960468c1..7fc83cb31e 100644 --- a/containers/hashistack/up.sh +++ b/containers/hashistack/up.sh @@ -4,3 +4,7 @@ mkdir -p logs consul agent -dev > logs/consul &! nomad agent -dev > logs/nomad &! vault server -dev > logs/vault &! + +# Export it now and add it to zshrc for later (in case of terminal exit) +export VAULT_ADDR="http://127.0.0.1:8200" +echo 'export VAULT_ADDR="http://127.0.0.1:8200"' >> ~/.zshrc