mirror of
https://github.com/garethgeorge/backrest.git
synced 2026-09-25 09:25:36 +00:00
feat: experimental multihost sync (#1204)
This commit is contained in:
+16
-19
@@ -1,22 +1,19 @@
|
||||
## Based on microsoft go devcontainer - https://github.com/microsoft/vscode-dev-containers/blob/v0.205.2/containers/go/.devcontainer/Dockerfile
|
||||
# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon): 1, 1.16, 1.17, 1-bullseye, 1.16-bullseye, 1.17-bullseye, 1-buster, 1.16-buster, 1.17-buster
|
||||
ARG VARIANT=1-bullseye
|
||||
FROM mcr.microsoft.com/vscode/devcontainers/go:${VARIANT}
|
||||
|
||||
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
|
||||
ARG NODE_VERSION="none"
|
||||
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
|
||||
|
||||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||
&& apt-get -y install --no-install-recommends protobuf-compiler
|
||||
FROM mcr.microsoft.com/devcontainers/base:bookworm
|
||||
|
||||
# Install Nix in single-user mode for the vscode user
|
||||
USER vscode
|
||||
RUN curl -L https://nixos.org/nix/install | bash -s -- --no-daemon
|
||||
ENV PATH="/home/vscode/.nix-profile/bin:${PATH}"
|
||||
|
||||
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest \
|
||||
&& go install github.com/bufbuild/buf/cmd/buf@v1.27.2 \
|
||||
&& go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest \
|
||||
&& go install google.golang.org/protobuf/cmd/protoc-gen-go@latest \
|
||||
&& go install connectrpc.com/connect/cmd/protoc-gen-connect-go@latest \
|
||||
&& go install github.com/GeertJohan/go.rice/rice@latest \
|
||||
&& go install github.com/goreleaser/goreleaser@latest \
|
||||
&& npm install -g @bufbuild/protoc-gen-es @connectrpc/protoc-gen-connect-es
|
||||
# Install direnv via Nix and configure shell hooks
|
||||
RUN . /home/vscode/.nix-profile/etc/profile.d/nix.sh \
|
||||
&& nix-env -iA nixpkgs.direnv
|
||||
RUN echo '. /home/vscode/.nix-profile/etc/profile.d/nix.sh' >> /home/vscode/.bashrc \
|
||||
&& echo 'eval "$(direnv hook bash)"' >> /home/vscode/.bashrc \
|
||||
&& echo '. /home/vscode/.nix-profile/etc/profile.d/nix.sh' >> /home/vscode/.zshrc \
|
||||
&& echo 'eval "$(direnv hook zsh)"' >> /home/vscode/.zshrc
|
||||
|
||||
# Pre-populate the nix store with project dependencies so first open is fast
|
||||
COPY shell.nix /tmp/shell.nix
|
||||
RUN . /home/vscode/.nix-profile/etc/profile.d/nix.sh \
|
||||
&& nix-shell /tmp/shell.nix --run "echo 'nix dependencies cached'"
|
||||
|
||||
@@ -1,49 +1,29 @@
|
||||
{
|
||||
"name": "Go",
|
||||
"name": "Backrest Dev",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile",
|
||||
"args": {
|
||||
// Update the VARIANT arg to pick a version of Go: 1, 1.16, 1.17
|
||||
// Append -bullseye or -buster to pin to an OS version.
|
||||
// Use -bullseye variants on local arm64/Apple Silicon.
|
||||
"VARIANT": "1-1.24-bookworm",
|
||||
// Options
|
||||
"NODE_VERSION": "lts/*"
|
||||
}
|
||||
"context": ".."
|
||||
},
|
||||
"runArgs": [
|
||||
"--cap-add=SYS_PTRACE",
|
||||
"--security-opt",
|
||||
"seccomp=unconfined"
|
||||
],
|
||||
"postCreateCommand": "direnv allow",
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
||||
"go.toolsManagement.checkForUpdates": "local",
|
||||
"go.useLanguageServer": true,
|
||||
"go.gopath": "/go",
|
||||
"go.goroot": "/usr/local/go",
|
||||
"typescript.tsdk": "webui/node_modules/typescript/lib",
|
||||
"typescript.enablePromptUseWorkspaceTsdk": true,
|
||||
"gitlens.telemetry.enabled": false
|
||||
"typescript.enablePromptUseWorkspaceTsdk": true
|
||||
},
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
"golang.Go",
|
||||
"ms-azuretools.vscode-docker",
|
||||
"mhutchie.git-graph",
|
||||
"eamodio.gitlens",
|
||||
"donjayamanne.githistory",
|
||||
"esbenp.prettier-vscode",
|
||||
"iulian-radu-at.vscode-tasks-sidebar"
|
||||
"mkhl.direnv",
|
||||
"esbenp.prettier-vscode"
|
||||
]
|
||||
}
|
||||
},
|
||||
// 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",
|
||||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
||||
"remoteUser": "vscode"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user