[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [atomic-devel] Problems with labels

On 05/04/2015 11:55 AM, Václav Pavlín wrote:

On 05/04/2015 10:57 AM, Pavel Odvody wrote:
On Thu, 2015-04-30 at 23:18 +0200, Václav Pavlín wrote:

I wanted to use CentOS Atomic Host and Docker images to package
atomicapp-run [1] into an image but I ran into troubles with docker and
docker-py (probably).

See http://fpaste.org/217373/30426738/

There is f.e. ${CONFDIR} specified in LABEL INSTALL, but it disappears
during docker build. I "fixed" this with adding a backslash in front of
dollar sign (\${CONFDIR}) so it persisted after the build. But when I ran

atomic install vpavlin/atomicapp-run

I got this incorrect cmd again:

docker run --rm -it --privileged -v /run:/run -v :/atomicapp -v /:/host
-v /answers.conf:/application-entity/answers.conf -e
IMAGE=vpavlin/wp-app -e NAME=wp-app --name wp-app vpavlin/wp-app
containerapp -v install --update --path /atomicapp /application-entity

This works completely fine on RHELAH, but there is a different docker

bash-4.2# docker --version
Docker version 1.5.0-dev, build fc0329b/1.5.0

CentOS AH:
bash-4.2# docker --version
Docker version 1.6.0, build bdbc177

So my guess it that docker somehow ignores/evaluates variables in LABELS
in 1.6.0...and even if they persist with the backslash fix, they get
lost by inspect() from docker-py used in atomic tool.

Any thoughts if this is intended or how to fix it/workaround it?


[1] https://github.com/vpavlin/atomicapp-run/blob/master/Dockerfile.centos

The patch by Dan was slightly altered before it went live:


How does the inspect output look like after you've escaped the dollars?

Ah, ok, this is obviously the problem:


Inspect looks sane:


Weirdly enough when I tried this:

bash-4.2# python -c "import docker; d = docker.Client(); print(d.inspect_image('vpavlin/atomicapp-run')['Config']['Labels']['INSTALL'])"

docker run --rm -it --privileged -v /run:/run -v ${DATADIR}:/atomicapp -v /:/host -v ${CONFDIR}/answers.conf:/application-entity/answers.conf -e IMAGE=IMAGE -e NAME=NAME --name NAME IMAGE containerapp -v install --update --path /atomicapp /application-entity

it worked just fine..so the problem is probably atomic cli..I'll try to debug it a bit more..


Well...escaping works..I had 2 similarly named images and mixed them up (one had variables escaped, second hadn't). So basically solved.

Sorry for confusion,


Lead Infrastructure Engineer
Developer Experience
Brno, Czech Republic
Phone: +420 739 666 824

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]