Код: Выделить всё
FROM mcr.microsoft.com/devcontainers/cpp:1-debian-12
ARG REINSTALL_CMAKE_VERSION_FROM_SOURCE="none"
# Optionally install the cmake for vcpkg
COPY ./reinstall-cmake.sh /tmp/
RUN if [ "${REINSTALL_CMAKE_VERSION_FROM_SOURCE}" != "none" ]; then \
chmod +x /tmp/reinstall-cmake.sh && /tmp/reinstall-cmake.sh ${REINSTALL_CMAKE_VERSION_FROM_SOURCE}; \
fi \
&& rm -f /tmp/reinstall-cmake.sh
# Install OpenGL dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
cmake \
libglfw3-dev \
libglew-dev \
libglm-dev \
mesa-utils \
x11-apps \
&& rm -rf /var/lib/apt/lists/*
# Create a non-root user (optional, but recommended)
ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID
# Add user to video group for GPU access
RUN usermod -aG video vscode
# Set up X11 permissions
RUN echo "export DISPLAY=:0" >> /home/$USERNAME/.bashrc
Код: Выделить всё
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp
{
"name": "C++",
"build": {
"dockerfile": "Dockerfile"
},
"runArgs": [
"--privileged",
// Enable GPU support if available
"--gpus=all",
// X11 forwarding
"-e",
"DISPLAY=${env:DISPLAY}",
"-v",
"/tmp/.X11-unix:/tmp/.X11-unix"
],
"remoteEnv": {
"DISPLAY": "${localEnv:DISPLAY}"
},
}
Подробнее здесь: https://stackoverflow.com/questions/791 ... ndows-host
Мобильная версия