-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update devcontainer pattern to a more modern style using the devcontainer "features" capability. * Switches the devcontainer user from root to vscode * Automatically add the toolchain and dev deps for static cross compilation * Fix issue with go dependecy
- Loading branch information
Showing
8 changed files
with
36 additions
and
1,017 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 |
---|---|---|
@@ -1,71 +1,14 @@ | ||
# See VSCode default image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/go/.devcontainer/base.Dockerfile | ||
FROM mcr.microsoft.com/devcontainers/base:bookworm@sha256:6155a486f236fd5127b76af33086029d64f64cf49dd504accb6e5f949098eb7e | ||
|
||
# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon) | ||
ARG GO_VARIANT=1.20.2-buster | ||
FROM golang:${GO_VARIANT} | ||
|
||
# Copy library scripts to execute | ||
COPY library-scripts/*.sh library-scripts/*.env /tmp/library-scripts/ | ||
|
||
# [Option] Install zsh | ||
ARG INSTALL_ZSH="true" | ||
# [Option] Upgrade OS packages to their latest versions | ||
ARG UPGRADE_PACKAGES="true" | ||
# Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies. | ||
ARG USERNAME=vscode | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
RUN bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" "true" "true" \ | ||
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* | ||
# Install Jekyll | ||
RUN bash /tmp/library-scripts/jekyll-debian.sh | ||
|
||
# Persist Bash History | ||
RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \ | ||
&& echo $SNIPPET >> "/root/.bashrc" | ||
|
||
# Install Go tools | ||
ENV GO111MODULE=auto | ||
RUN bash /tmp/library-scripts/go-debian.sh "none" "/usr/local/go" "${GOPATH}" "${USERNAME}" "false" \ | ||
&& go install golang.org/x/tools/gopls@latest \ | ||
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Rust tools | ||
RUN bash /tmp/library-scripts/rust-debian.sh "${CARGO_HOME}" "${RUSTUP_HOME}" "${USERNAME}" "true" "true" \ | ||
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* | ||
|
||
# Install gRPC tools | ||
ENV CARGO_HOME="/usr/local/cargo" | ||
ENV RUSTUP_HOME="/usr/local/rustup" | ||
ENV PATH=${CARGO_HOME}/bin:${PATH} | ||
RUN apt update -y \ | ||
&& apt install -y protobuf-compiler libprotobuf-dev \ | ||
&& go install google.golang.org/protobuf/cmd/[email protected] \ | ||
&& go install google.golang.org/grpc/cmd/[email protected] \ | ||
&& cargo install protobuf-codegen | ||
|
||
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10 | ||
ARG NODE_VERSION="lts/*" | ||
ENV NVM_DIR=/usr/local/share/nvm | ||
ENV NVM_SYMLINK_CURRENT=true \ | ||
PATH=${NVM_DIR}/current/bin:${PATH} | ||
RUN bash /tmp/library-scripts/node-debian.sh "${NVM_DIR}" "${NODE_VERSION}" "${USERNAME}" \ | ||
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Jekyll | ||
RUN bash /tmp/library-scripts/jekyll-debian.sh | ||
|
||
# Remove library scripts for final image | ||
RUN rm -rf /tmp/library-scripts | ||
|
||
# [Choice] Node.js version: lts/*, 16, 14, 12, 10 | ||
#ARG NODE_VERSION="lts/*" | ||
#RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c ". /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi | ||
|
||
# [Optional] Uncomment this section to install additional OS packages. | ||
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
# && apt-get -y install --no-install-recommends <your-package-list-here> | ||
|
||
# [Optional] Uncomment the next line to use go get to install anything else you need | ||
# RUN go get -x <your-dependency-or-tool> | ||
|
||
# [Optional] Uncomment this line to install global node packages. | ||
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1 | ||
# Install additional rust dependencies for static cross compile builds | ||
RUN apt update && apt install -y musl-tools gcc-mingw-w64 |
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.