intel / cc-oci-runtime

OCI (Open Containers Initiative) compatible runtime for Intel® Architecture
GNU General Public License v2.0
417 stars 59 forks source link

Revisit env variables we set with cc-oci-runtime #324

Closed gorozco1 closed 7 years ago

gorozco1 commented 8 years ago

This issue is mostly to avoid some of the workarounds we have with cc-oci-runtime and some containers images:

Problem examples:

docker run --runtime cor  ubuntu /usr/bin/perl -e 'exit 55'
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
$ docker run -ti mongo --auth
2016-10-11T16:16:20.373+0000 F CONTROL  [main] Failed global initialization: BadValue: Invalid or no user locale set. Please ensure LANG and/or LC_* environment variables are set correctly.

If we take a look at the variables set with clasic containers we can notice they only set 3 variables:

$ docker run --runtime runc debian env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=c3fdf19a6cff
HOME=/root

And with cc-oci-runtime we set more variables. The one that I notice is getting more problems is LANG=en_US.UTF-8

$ docker run --runtime cor debian env
HOSTNAME=7801d7470a7d
HOME=/root
OLDPWD=/
TERM=vt220
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
LANG=en_US.UTF-8
PWD=/
grahamwhaley commented 7 years ago

There is a potentially related item over at https://github.com/coreos/rkt/pull/3219 around PWD that is worth looking at at the same time - based around root dirs and 9pfs etc.

lucab commented 7 years ago

@grahamwhaley I was wrong in my initial investigation on this, it turned out to be a problem due to cross-compiled bash. I'm still unsure why this showed up only on qemu-9p, but I verified that rkt bug is fixed by https://github.com/coreos/coreos-overlay/pull/2272.

amshinde commented 7 years ago

@GabyCT This should be fixed with image 12860. Can you please verify.

gorozco1 commented 7 years ago

@amshinde this means we need to update clear-containers image?

amshinde commented 7 years ago

@gorozco1 yes will need to. Though the image hasnt been packaged yet. Need to download from: https://download.clearlinux.org/releases/12860/clear/

GabyCT commented 7 years ago

@amshinde this was verified with clear-12860 image and CC 2.1. It looks that is working properly docker run -ti perl perl -e 'print "Hello World\n"' Hello World