diff --git a/run_linux.go b/run_linux.go index d83b3a5cc98..66a3ba99745 100644 --- a/run_linux.go +++ b/run_linux.go @@ -91,11 +91,8 @@ func (b *Builder) Run(command []string, options RunOptions) error { return err } - defaultContainerConfig, err := config.Default() - if err != nil { - return errors.Wrapf(err, "failed to get container config") - } - b.configureEnvironment(g, options, defaultContainerConfig.Containers.Env) + // hardwire the environment to match docker build to avoid subtle and hard-to-debug differences due to containers.conf + b.configureEnvironment(g, options, []string{"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"}) if b.CommonBuildOpts == nil { return errors.Errorf("Invalid format on container you must recreate the container") diff --git a/tests/containers_conf.bats b/tests/containers_conf.bats index 88efd3ec305..4fc3bb86f7c 100644 --- a/tests/containers_conf.bats +++ b/tests/containers_conf.bats @@ -2,12 +2,6 @@ load helpers -@test "containers.conf env test" { - export CONTAINERS_CONF=${TESTSDIR}/containers.conf - cid=$(buildah from --pull --signature-policy ${TESTSDIR}/policy.json docker.io/alpine) - run_buildah --log-level=error run $cid sh -c 'env | grep "foo=bar"' -} - @test "containers.conf selinux test" { if ! which selinuxenabled > /dev/null 2> /dev/null ; then skip "No selinuxenabled executable"