Bug 1123134 - set container=docker environment variable inside RHEL containers
Summary: set container=docker environment variable inside RHEL containers
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: rhel-server-container
Version: 7.1
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Václav Pavlín
QA Contact:
Depends On:
Blocks: 1070851 1186007
TreeView+ depends on / blocked
Reported: 2014-07-25 00:06 UTC by Jeremy Eder
Modified: 2015-03-05 01:55 UTC (History)
6 users (show)

Fixed In Version: rhel-server-docker-7.1-4
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2015-03-05 01:55:13 UTC

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2015:0615 normal SHIPPED_LIVE New Red Hat Enterprise Linux 7.1 Container Image 2015-03-05 06:54:47 UTC

Comment 2 Daniel Walsh 2014-07-25 15:13:29 UTC
Just created a pull request to add this functionality


Comment 3 Daniel Walsh 2014-09-12 19:18:44 UTC
We have the fix in docker-1.2 although not upstream yet.

We need to build a docker image with this version and set the environment variable.

Comment 4 Daniel Walsh 2014-11-20 19:25:02 UTC
docker --change should allow us to do this.  Will build this into docker-1.3.2-HTB.

Comment 5 Daniel Walsh 2015-01-19 15:07:10 UTC
docker --change is now in docker-1.4.1-10.el7

Comment 6 Václav Pavlín 2015-01-20 07:15:29 UTC
I've talked about it with Ian Mcleod and he should have fix ready soon. I've also asked him to set bash as default CMD for base images.

Comment 15 Luwen Su 2015-02-04 10:14:25 UTC
If my understanding is correct, the bug's key points split two parts.
1.The lastest RHEL image includes the ENV container=docker
With rhel-tools-docker-7.1-7.x86_64
# docker inspect -f {{.Config.Env}} rhel-tools-docker-7.1-7.x86_64
# docker run rhel-tools-docker-7.1-7.x86_64 env | grep -i container

2.Docker provides a machnism to support configurate the ENV in the image/container.
For what i know, 
ENV keyword in Dockerfile, few command with -e option and the --change option work for this purpose


Comment 16 Václav Pavlín 2015-02-04 11:17:00 UTC
Ok, the question here is if this bug applies to

1) RHEL Base images,
2) rhel-tools, rsyslog... images,
3) both

In case of 1) we don't have that yet. It works for 2) and 3) is obvious result of previous statements. Can someone (Dan, Jen?) switch the bug to correct component? Because it is obviously not Docker.

Comment 17 Daniel Walsh 2015-02-04 15:33:07 UTC
All of Red Hat images should have this.  It will get a lot easier 0nce we are building layered images.

Comment 19 Luwen Su 2015-02-16 07:29:28 UTC
# docker run -it rhel-server-docker-7.1-4.x86_64
# export
declare -x container="docker"

move to verified

Comment 21 errata-xmlrpc 2015-03-05 01:55:13 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.