On 05/04/2015 11:55 AM, Václav Pavlín wrote:
Well...escaping works..I had 2 similarly named images and mixed them up (one had variables escaped, second hadn't). So basically solved.On 05/04/2015 10:57 AM, Pavel Odvody wrote:On Thu, 2015-04-30 at 23:18 +0200, Václav Pavlín wrote:Hello, 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 ofdollar sign (\${CONFDIR}) so it persisted after the build. But when I ranatomic 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 verison: RHELAH: 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 bdbc177So my guess it that docker somehow ignores/evaluates variables in LABELSin 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? Thanks, Vašek[1] https://github.com/vpavlin/atomicapp-run/blob/master/Dockerfile.centosThe patch by Dan was slightly altered before it went live:https://github.com/docker/docker/commit/6784a772baaa20936f00b8adc00a4b4444356181How does the inspect output look like after you've escaped the dollars?Ah, ok, this is obviously the problem:https://github.com/docker/docker/commit/6784a772baaa20936f00b8adc00a4b4444356181#diff-f2e06c4c86a2d1a78ee535fe356a603dR52Inspect looks sane: http://fpaste.org/218133/14307327/ 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-entityit worked just fine..so the problem is probably atomic cli..I'll try to debug it a bit more..Vašek
Sorry for confusion, Vašek -- Lead Infrastructure Engineer Developer Experience Brno, Czech Republic Phone: +420 739 666 824