From c82d2de6b053ed0cfebc5c81dfc004c94d7c1bcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Garc=C3=ADa?= <4411661+GarciaLnk@users.noreply.github.com> Date: Thu, 6 Feb 2025 08:28:41 +0000 Subject: [PATCH] feat(devcontainer): simplify image (#3205) This simplifies the devcontainer using the builder image as the base and adding the common-utils feature (which takes care of creating the vscode user and more). --- .devcontainer/Dockerfile | 9 --------- .devcontainer/devcontainer.json | 15 ++++++++------- 2 files changed, 8 insertions(+), 16 deletions(-) delete mode 100644 .devcontainer/Dockerfile diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index 76f0c89a8d..0000000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -ARG VARIANT="rawhide" -FROM fedora:${VARIANT} - -RUN useradd -m vscode -RUN groupadd mock -RUN usermod -aG mock vscode -RUN echo vscode ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/vscode -RUN curl -Lo /etc/yum.repos.d/terra.repo https://raw.githubusercontent.com/terrapkg/subatomic-repos/main/terra.repo -RUN dnf -y install git mock createrepo_c anda terra-mock-configs diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ed271bdb32..96c9104ef2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,18 +1,19 @@ { - "name": "Fedora", - "build": { - "dockerfile": "Dockerfile", - "args": { "VARIANT": "rawhide" } - }, - "remoteUser": "vscode", + "name": "Terra Devcontainer", + "image": "ghcr.io/terrapkg/builder:frawhide", "runArgs": [ "--privileged" ], + "features": { + "ghcr.io/devcontainers/features/common-utils:2": {} + }, "customizations": { "vscode": { "extensions": [ "rhaiscript.vscode-rhai" ] } - } + }, + "remoteUser": "vscode", + "onCreateCommand": "sudo usermod -a -G mock vscode" }