From 1250160b91b6b062730d3c50d046330fe3d303e2 Mon Sep 17 00:00:00 2001 From: Marek Lesko Date: Wed, 3 Sep 2025 15:26:40 +0000 Subject: [PATCH] FIXED devcontainer --- .devcontainer/Dockerfile | 22 +++------------------- .devcontainer/devcontainer.json | 25 ++++++++++++++++--------- 2 files changed, 19 insertions(+), 28 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 951e657..7f7f703 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,20 +1,4 @@ -FROM docker:20.10-dind +FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine -# Switch to Debian-based image for better .NET support -RUN apk add --no-cache bash curl gnupg - -# Install .NET 8 SDK -ENV DOTNET_VERSION=8.0 - -RUN curl -sSL https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh -o dotnet-install.sh \ - && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --version $DOTNET_VERSION --install-dir /usr/share/dotnet \ - && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet - -# Verify installation -RUN dotnet --version - -# Optional: install other tools -RUN apk add --no-cache git make vim go - -USER root +# Optional: install Docker CLI (not Docker daemon) +RUN apk add --no-cache docker-cli bash git diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 3e4a76c..9790d0f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,18 +3,25 @@ // // See https://aka.ms/devcontainer.json for more information. { - "name": "Simple Id Server", - // Use "image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04", - // instead of the build to use a pre-built image. - "build": { + "name": "Simple Id Server", + // Use "image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04", + // instead of the build to use a pre-built image. + "build": { "context": ".", "dockerfile": "Dockerfile" - } - // Features add additional features to your environment. See https://containers.dev/features - // Beware: features are not supported on all platforms and may have unintended side-effects. - // "features": { + }, + "runArgs": [ + "--privileged" + ], + "mounts": [ + "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" + ], + "remoteUser": "root" + // Features add additional features to your environment. See https://containers.dev/features + // Beware: features are not supported on all platforms and may have unintended side-effects. + // "features": { // "ghcr.io/devcontainers/features/docker-in-docker": { // "moby": false // } // } -} +} \ No newline at end of file