-
Notifications
You must be signed in to change notification settings - Fork 633
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
environment variables of current shell can't be passed to container via nerdctl run '-e' option #1487
Comments
I tired this and noticed this might because the different behavior between docker and containerd: Docker said an env without value (e.g., Containerd said that means unsetting the value: nerdctl, containerd. Though I'm not sure if this is expected containerd behavior defined in oci. cc: @AkihiroSuda |
@sixwaaaay btw, I think you can work around this by |
This command does not seem to work for passing environment variables with multi-line text export X=`cat file | base64 -w 0` # export X=`printenv X | base64 -w 0`
nerdctl run -e X=$X alpine printenv X | base64 -d I think it seems a little troubling |
@sixwaaaay Do you want this? root# export X="aaa
> bbb"
root# echo "$X"
aaa
bbb
root# _output/nerdctl run --rm --env X alpine printenv X
aaa
bbb |
Add a function to process env/envfile specified by users and set value for env with no value has been set. Fixes: containerd#1487 Signed-off-by: bin liu <liubin0329@gmail.com>
Add a function to process env/envfile specified by users and set value for env with no value has been set. Fixes: containerd#1487 Signed-off-by: bin liu <liubin0329@gmail.com>
Add a function to process env/envfile specified by users and set value for env with no value has been set. Fixes: containerd#1487 Signed-off-by: bin liu <liubin0329@gmail.com>
Add a function to process env/envfile specified by users and set value for env with no value has been set. Fixes: containerd#1487 Signed-off-by: bin liu <liubin0329@gmail.com>
Add a function to process env/envfile specified by users and set value for env with no value has been set. Fixes: containerd#1487 Signed-off-by: bin liu <liubin0329@gmail.com>
Description
behaivors as follow will print
10
export X=10 docker run -e X alpine printenv X
however, nothing will be printed when I use nerdctl
export X=10 nerdctl run -e X alpine printenv X
Steps to reproduce the issue
export X=10
nerdctl run -e X alpine printenv X
Describe the results you received and expected
result: nothing
expected: print 10
What version of nerdctl are you using?
nerdctl version:
Client:
Version: v1.0.0
OS/Arch: linux/amd64
Git commit: c00780a
buildctl:
Version: v0.10.5
GitCommit: bc26045116045516ff2427201abd299043eaf8f7
Server:
containerd:
Version: v1.6.9
GitCommit: 1c90a442489720eec95342e1789ee8a5e1b9536f
runc:
Version: 1.1.4
GitCommit: v1.1.4-0-g5fd4c4d1
Are you using a variant of nerdctl? (e.g., Rancher Desktop)
No response
Host information
OS information:
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
The text was updated successfully, but these errors were encountered: