Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postCreateCommand deletes git config #476

Open
luftuq opened this issue Jul 16, 2024 · 2 comments
Open

postCreateCommand deletes git config #476

luftuq opened this issue Jul 16, 2024 · 2 comments

Comments

@luftuq
Copy link

luftuq commented Jul 16, 2024

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
@0943916975
Copy link

[email protected]

@samruddhikhandale
Copy link
Member

@gauravsaini04 / @prathameshzarkar9 Can either of you help investigate the issue? thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants