Open dss010101 opened 2 months ago
though i dont know if its relevant here i are my docker file and docker-compose: docker file:
FROM mcr.microsoft.com/devcontainers/rust:1-1-bullseye as aipg_client_base
ENV TZ=America/New_York
ARG ENV
ARG USER_ID
ARG GROUP_ID
ARG USER_NAME
ARG APP_HOME="/apps/aipg_client_base"
RUN echo "env: $ENV, user: $USER_NAME, user_id: $USER_ID, app_home: $APP_HOME"
RUN apt-get update && apt-get -y install acl iputils-ping less libpq-dev nano postgresql-client sudo
RUN groupadd -g $GROUP_ID -o $USER_NAME
RUN useradd -m -s /bin/bash -u $USER_ID -g $GROUP_ID $USER_NAME
FROM aipg_client_base as aipg_client_local
#attempt at handling this target folder issue...
RUN mkdir -p /workspaces/aipg_client/target
RUN chown -R vscode:vscode /workspaces/aipg_client/target
RUN chmod -R 777 /workspaces/aipg_client/target
docker-compose:
networks:
aipg_client_net:
driver: bridge
services:
aipg_client:
container_name: aipg_client_${ENV}
image: "aipg_client:${VERSION}"
build:
context: ..
dockerfile: .devcontainer/Dockerfile
target: aipg_client_local
args:
ENV: ${ENV:-local}
USER_ID: ${USER_ID:-1000}
GROUP_ID: ${GROUP_ID:-1000}
USER_NAME: ${USER_NAME}
shm_size: '2gb'
env_file:
- ./.env
volumes:
- ../..:/workspaces
- ~/.ssh:/home/${USER_NAME}/.ssh
- //var/run/docker.sock:/var/run/docker.sock
command: sleep infinity
shm_size: 0.94gb
ports:
- "${SVC_PORT}:5000"
networks:
- aipg_client_net
.env file:
VERSION=local
ENV=local
USER_ID=197609
#USER_ID=1001
GROUP_ID=1000
USER_NAME=user1
SVC_PORT=6000
if i add a .cargo/config.toml with the target anywhere outside my project workspace, it seems to work fine
[build]
target-dir = "/tmp/target"
But of course that means anytime i restart/rebuild the container, i have to rebuild the project/binaries. which makes it not seem like a good solution
Anyone with any advice on how to go about resolving this?
Description
Im not sure if should be reaching out here or vscode for help on this...but i will start here and let me know if im int he wrong location..
i have built a vs code devcontainer based on
mcr.microsoft.com/devcontainers/rust:1-1-bullseye
, running under Docker Desktop on windows 11. I am able to run a basic example using this without any dependenciesi have the following structure (Note: the target and Cargo.lock do not exist until after i attempt a
cargo build
:My toml looks like this:
when i do
Cargo build
or run from command line, i see this:i checked these folders and they are all r/w. What am i doing wrong?
Reproduce
cargo new test
cargo build
twiceExpected behavior
No response
docker version
docker info
Diagnostics ID
C4BAD374-B462-4BF5-90BC-244E3E1841E5/20240517055357
Additional Info
No response