postCreateCommand deletes git config
Hi all,
I see inconsistent result when I run
"postCreateCommand": "git config --global user.signingkey /home/mambauser/.ssh/id_ed25519.pub"
to redirect my keys to docker folder. All other global configurations (which are moved to docker automatically) are not in container. This does not happen if I change it to postStartCommand. I would expect that result would be the same. Simplified devcontainer.json where it happens is here:
{
"name": "name",
"build":{
"dockerfile": "Dockerfile",
"context": "../",
"args": { "HTTP_PROXY": "${localEnv:HTTP_PROXY}",
"HTTPS_PROXY": "${localEnv:HTTPS_PROXY}"
}
},
"containerEnv": { "HTTP_PROXY": "${localEnv:HTTP_PROXY}",
"HTTPS_PROXY": "${localEnv:HTTPS_PROXY}"
},
"mounts": [
"source=${localEnv:USERPROFILE}/.ssh,target=/home/mambauser/.ssh,type=bind,consistency=cached"
],
"postCreateCommand": "git config --global user.signingkey /home/mambauser/.ssh/id_ed25519.pub"
}
and the dockerfile:
FROM mambaorg/micromamba
ARG MAMBA_DOCKERFILE_ACTIVATE=1
RUN micromamba config append channels conda-forge
# Install Git
USER root
RUN apt-get update && apt-get install -y git
USER $MAMBA_USER
@gauravsaini04 / @prathameshzarkar9 Can either of you help investigate the issue? thanks!
Hi @luftuq, Thank you for reporting this issue. To help us understand and resolve it more efficiently, could you please provide a minimal reproduction example? This will allow us to replicate the problem on our end and investigate it further.
Hi @luftuq
Thank you for raising this issue and for your patience
As there hasn't been any recent activity on this issue, we're going to close it for now
If you have any further updates or if the issue still persists, please feel free to reopen it or create a new issue
Hi @gauravsaini04, I am sorry it took me a while. Here is really minimal reproduction I can do. devcontainer.json:
{
"name": "name",
"build":{
"dockerfile": "Dockerfile",
"context": "../"
//"args": { "HTTP_PROXY": "${localEnv:HTTP_PROXY}",
// "HTTPS_PROXY": "${localEnv:HTTPS_PROXY}"
// }
},
"postCreateCommand": "git config --global user.name test"
}
Dockerfile:
FROM mambaorg/micromamba
USER root
RUN apt-get update && apt-get install -y git
USER $MAMBA_USER
The issue is, that if I switch postCreateCommand for postStartCommand, I will get different results after rebuild.
Hello @luftuq ,
Thank you for your patience and for providing simpler steps to reproduce the issue. I have one final request in this regard. You have mentioned in the issue description that certain global configurations which had moved automatically to the docker container were retained while using the postStartCommand tag. Would you kindly point them out for my better understanding of the issue?
With Regards, Kaniska