From 4b42b39e8f9f95c816c0e13924af3f600ea80260 Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Tue, 2 Jul 2024 11:58:03 +0200 Subject: [PATCH 1/2] Allow to build project in container and to use vscode devcontainer for development --- .devcontainer/Dockerfile | 16 +++++++++++-- .devcontainer/devcontainer.json | 39 ++++++++++++++++++++++++++++---- .devcontainer/docker-compose.yml | 9 ++++++++ .github/dependabot.yml | 12 ++++++++++ 4 files changed, 69 insertions(+), 7 deletions(-) create mode 100644 .devcontainer/docker-compose.yml create mode 100644 .github/dependabot.yml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 69eccefb..70513d72 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,3 +1,15 @@ -FROM node:18-bullseye +FROM ubuntu + +ENV DEBIAN_FRONTEND=noninteractive +RUN apt update \ + && apt upgrade -y \ + && apt install -y curl git python3 python-is-python3 build-essential jq rsync libkrb5-dev libsecret-1-dev + +RUN curl https://get.volta.sh | bash +ENV VOLTA_FEATURE_PNPM=1 +ENV VOLTA_HOME "/root/.volta" +ENV PATH "$VOLTA_HOME/bin:$PATH" + +RUN volta install node@20 \ + && volta install yarn@1 -RUN apt update -y && apt install -y jq rsync libsecret-1-dev diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index c6d5e91c..2b00dfb3 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,7 +1,36 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile { - "name": "monaco-vscode-api", - "build": { - "context": ".", - "dockerfile": "./Dockerfile" - } + "name": "mva-docker", + "build": { + // Sets the run context to one level up instead of the .devcontainer folder. + "context": "..", + // Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename. + "dockerfile": "./Dockerfile" + }, + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Uncomment the next line to run commands after the container is created. + // "postCreateCommand": "cat /etc/os-release", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "ubuntu", + + // "mounts": [ + // { + // "source": "${localWorkspaceFolder}", + // "target": "/home/ubuntu/monaco-vscode-api", + // "type": "bind" + // } + // ], + + // "workspaceFolder": "/home/ubuntu/monaco-vscode-api" } diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 00000000..ddd10ac3 --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -0,0 +1,9 @@ +services: + monaco-vscode-api-dev: + build: + dockerfile: ./.devcontainer/Dockerfile + context: .. + image: monaco-vscode-api-dev + container_name: monaco-vscode-api-dev + volumes: + - ./:/home/ubuntu/monaco-vscode-api diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..f33a02cd --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for more information: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +# https://containers.dev/guide/dependabot + +version: 2 +updates: + - package-ecosystem: "devcontainers" + directory: "/" + schedule: + interval: weekly From b28e5085a1646397b7877fe50a80b24ca2cc53c9 Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Mon, 8 Jul 2024 15:25:32 +0200 Subject: [PATCH 2/2] fix: implement review comment. Fix ubuntu version of base image --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 70513d72..c705c5f5 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu +FROM ubuntu:noble-20240605 ENV DEBIAN_FRONTEND=noninteractive RUN apt update \