1

whenever I run the dev engine, I get the following error at the end of the install:

chown: invalid group: ‘root:docker’
WARNING: Could not change owner for docker socket in container : exit code 1
Docker socket permission set to allow in container docker

I am on macOS, so not sure if I need to create a docker group or not.

I have the following Dockerfile.devenv

FROM python:3.9-buster
COPY requirements.txt requirements.txt
COPY . .
RUN pip install -r requirements.txt
USER root
WORKDIR /src
EXPOSE 8000
RUN useradd -ms /bin/bash devenv

and no docker compose file.

bkapz
  • 65
  • 5

1 Answers1

1

According to the documentation: https://docs.microsoft.com/en-us/visualstudio/mac/docker-quickstart?view=vsmac-2019

It could be possible to run the service of Visual Studio by configurating the dockerfile:

FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/core/sdk:2.2-stretch AS build
WORKDIR /src
COPY DockerDemo/DockerDemo.csproj DockerDemo/
RUN dotnet restore "DockerDemo/DockerDemo.csproj"
COPY . .
WORKDIR "/src/DockerDemo"
RUN dotnet build "DockerDemo.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "DockerDemo.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "DockerDemo.dll"]

So it could be possible to run your python environment within the environment for visual studio to run over macOS:

FROM python:3.9-buster
COPY requirements.txt requirements.txt
COPY . .
RUN pip install -r requirements.txt
USER root
WORKDIR /src
EXPOSE 8000
RUN useradd -ms /bin/bash devenv

FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim AS base
WORKDIR /src
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/core/sdk:2.2-stretch AS build
WORKDIR /src
COPY DockerDemo/DockerDemo.csproj DockerDemo/
RUN dotnet restore "DockerDemo/DockerDemo.csproj"
COPY . .
WORKDIR "/src/DockerDemo"
RUN dotnet build "DockerDemo.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "DockerDemo.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /src
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "DockerDemo.dll"]
TheFunSideofData
  • 1,284
  • 1
  • 11
  • 26
  • so I think this deploys a remote instance of vscode for a demo app that will run online. I am just trying to get the new Dev Environment (or really any containerized environment for python) running on VSCode locally. Once I have a docker container running, I can attach with the Remote Explorer. But when I try to do so, I get the above error message. Normally I would just let it deploy normally, but it detects the 'main repository language' as jupyter notebook rather than python and so doesn't install the python dependencies. – bkapz Feb 22 '22 at 14:30
  • 1
    That sounds that it can be fixed by creating a docker group first, probably this can help: https://stackoverflow.com/questions/48957195/how-to-fix-docker-got-permission-denied-issue – TheFunSideofData Feb 25 '22 at 17:58