This repository has been archived by the owner on Feb 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Dev Container / Updated Contributor Doc (#299)
* added basic dev container * added docker-lock * Added helm * updated contributing instructions * fixed spacing Co-authored-by: Michael Perel <[email protected]> Co-authored-by: Evan Louie <[email protected]>
- Loading branch information
1 parent
e8a80bc
commit 2b389c9
Showing
4 changed files
with
104 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM ubuntu:bionic | ||
|
||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
|
||
ARG GO_VERSION=1.14.2 | ||
ARG GOLANGCI_LINT_VERSION=1.25.0 | ||
ARG HELM_VERSION=3.1.2 | ||
ARG DOCKER_VERSION=19.03.8 | ||
ARG DOCKER_LOCK_VERSION=0.2.0 | ||
|
||
RUN apt-get update && \ | ||
apt-get -y install vim curl wget gcc software-properties-common && \ | ||
add-apt-repository ppa:git-core/ppa -y && \ | ||
apt-get update && \ | ||
apt-get install git -y && \ | ||
curl -fsSL "https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz" | tar -xz && \ | ||
mv linux-amd64/helm /usr/local/bin && \ | ||
rm -rf linux-amd64 && \ | ||
curl -fsSL "https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz" | tar -xz -C /usr/local docker/docker && \ | ||
mkdir -p "${HOME}/.docker/cli-plugins" && \ | ||
curl -fsSL "https://github.com/michaelperel/docker-lock/releases/download/v${DOCKER_LOCK_VERSION}/docker-lock-linux" -o "${HOME}/.docker/cli-plugins/docker-lock" && \ | ||
chmod +x "${HOME}/.docker/cli-plugins/docker-lock" && \ | ||
curl -fsSL "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" | tar -xz -C /usr/local && \ | ||
curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash -s -- -b "${HOME}/go/bin" "v${GOLANGCI_LINT_VERSION}" && \ | ||
echo "export PATH=/usr/local/go/bin:${HOME}/go/bin:/usr/local/docker:${PATH}" >> "${HOME}/.bashrc" && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or the definition README at | ||
// https://github.com/microsoft/vscode-dev-containers/tree/master/containers/docker-existing-dockerfile | ||
{ | ||
"name": "Dev Dockerfile", | ||
"dockerFile": "Dockerfile", | ||
// The optional 'runArgs' property can be used to specify additional runtime arguments. | ||
"runArgs": [ | ||
// Enable go debugger | ||
"--cap-add=SYS_PTRACE", | ||
"--security-opt", | ||
"seccomp=unconfined", | ||
// map host docker daemon into container for sibling containers | ||
"-v", | ||
"/var/run/docker.sock:/var/run/docker.sock" | ||
], | ||
"settings": { | ||
"files.eol": "\n", | ||
"terminal.integrated.shell.linux": "/bin/bash", | ||
// Go recommended settings with modules: https://github.com/golang/tools/blob/master/gopls/doc/vscode.md#vscode | ||
"go.useLanguageServer": true, | ||
"go.lintTool": "golangci-lint", | ||
"go.lintFlags": [ | ||
"--fast" | ||
], | ||
"[go]": { | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": true | ||
}, | ||
// Optional: Disable snippets, as they conflict with completion ranking. | ||
"editor.snippetSuggestions": "none" | ||
}, | ||
"[go.mod]": { | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": true | ||
} | ||
}, | ||
"gopls": { | ||
// Add parameter placeholders when completing a function. | ||
"usePlaceholders": true | ||
} | ||
}, | ||
"extensions": [ | ||
"ms-vscode.go" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"dockerfiles": { | ||
"Dockerfile": [ | ||
{ | ||
"name": "ubuntu", | ||
"tag": "bionic", | ||
"digest": "b58746c8a89938b8c9f5b77de3b8cf1fe78210c696ab03a1442e235eea65d84f" | ||
} | ||
] | ||
}, | ||
"composefiles": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters