diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 000000000000..2f0effc828ea --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,10 @@ +ARG VARIANT="1-1.21-bullseye" +FROM mcr.microsoft.com/devcontainers/go:${VARIANT} + +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive + +RUN type -p curl >/dev/null || (apt-get install curl -y) + + +# install gloud sdk +RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && apt-get update -y && apt-get install google-cloud-cli -y diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000000..cb697c43f726 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,18 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/go +{ + "name": "Go 1.21.0", + "build": { + "dockerfile": "Dockerfile" + }, + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "bash .devcontainer/postCreate.sh", + // Configure tool-specific properties. + "customizations": { + "vscode": { + "extensions": [ + "ms-azuretools.vscode-docker" + ] + } + } +} diff --git a/.devcontainer/postCreate.sh b/.devcontainer/postCreate.sh new file mode 100644 index 000000000000..c28a5e814e66 --- /dev/null +++ b/.devcontainer/postCreate.sh @@ -0,0 +1,4 @@ +echo "Post Create Starting" + +go version +go mod tidy