Skip to content

Commit

Permalink
Updating dev container
Browse files Browse the repository at this point in the history
Signed-off-by: Mikkel Mørk Hegnhøj <[email protected]>
  • Loading branch information
mikkelhegn committed Sep 10, 2024
1 parent bef25d6 commit 720f837
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,54 @@
# it avoids downloading any platform-specific binaries, and installs the required
# tools either through Debian's package manager, or through installation scripts
# that download the appropriate binaries.
FROM mcr.microsoft.com/devcontainers/base:jammy
FROM mcr.microsoft.com/devcontainers/base:ubuntu

# provided by docker
ARG TARGETARCH
ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID

RUN apt-get update && apt-get install -y \
nodejs \
npm \
python3-pip
# Install Python
RUN sudo apt update
RUN sudo apt install python3.10-venv -y

# Install Go
ARG GO_VERSION="1.22.1"
ARG GO_VERSION="1.23.1"
RUN wget -O go.tar.gz "https://go.dev/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz" && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
ENV PATH="$PATH:/usr/local/go/bin"

# Install TinyGo
ARG TINYGO_VERSION="0.31.1"
ARG TINYGO_VERSION="0.33.0"
RUN wget "https://github.com/tinygo-org/tinygo/releases/download/v${TINYGO_VERSION}/tinygo_${TINYGO_VERSION}_${TARGETARCH}.deb" && \
dpkg -i "tinygo_${TINYGO_VERSION}_${TARGETARCH}.deb"

# Install Spin
ARG SPIN_VERSION="v2.3.1"
ARG SPIN_VERSION="v2.7.0"
RUN mkdir -p /opt/spin && \
cd /opt/spin && \
curl -fsSL https://developer.fermyon.com/downloads/install.sh | bash -s -- -v $SPIN_VERSION && \
ln -s /opt/spin/spin /usr/local/bin/spin

# Set the current user before spin install for plugins/templates
USER $USERNAME

# Install Rust
ENV PATH="$PATH:/home/$USERNAME/.cargo/bin"
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- \
-y --target wasm32-wasi

# Set the current user before spin install for plugins/templates
USER $USERNAME

# Install Node and NPM
ARG NODE_VERSION=20
ENV NVM_DIR=/home/${USERNAME}/.nvm
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION}
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}"
#RUN node --version
#RUN npm --version

# Install Spin Plugins & Templates
RUN spin plugins update && \
spin plugins install check-for-update -y && \
Expand Down

0 comments on commit 720f837

Please sign in to comment.