android - Docker ENV command no longer valid when using docker run -
i trying build android application within docker container, i'm having trouble setting environment variables when call docker run
. i've created dockerfile
@ ci/dockerfile
looks like:
from centos maintainer jonathan maltz <my@email.com> # install development tools run yum -y groupinstall "development tools" # yum update run yum -y update # install java (openjdk) run yum -y install java-1.7.0-openjdk-devel # install 32bit library run yum -y install glibc.i686 run yum -y install libstdc++.i686 run yum -y install glibc-devel.i686 run yum -y install zlib-devel.i686 run yum -y install ncurses-devel.i686 run yum -y install libx11-devel.i686 run yum -y install libxrender.i686 # install android sdk run cd /usr/local/ && curl -l -o http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz && tar xf android-sdk_r24.4.1-linux.tgz # environment variables env android_home /usr/local/android-sdk-linux env path $path:$android_home/tools env path $path:$android_home/platform-tools # install android tools run android list sdk --all run echo y | android update sdk --filter tool --no-ui --force -a run echo y | android update sdk --filter platform-tool --no-ui --force -a run echo y | android update sdk --filter platform --no-ui --force -a run echo y | android update sdk --filter --no-ui --force -a # clean run rm -rf /usr/local/android-sdk_r24.4.1-linux.tgz run yum clean workdir /mounted/volume cmd ./gradlew assembledebug
then, in makefile, have target called test simply:
docker build -t my/container ci docker run -v $(shell pwd):/mounted/volume my/container
when run make test
container configured, when gradlew assembledebug
run, error message "the sdk directory '/users/maltz/android-sdk' not exist." confusing, because path local android sdk installation, not android_home
configured in dockerfile
.
so, question is: why doesn't docker run
respect android_home
value set in dockerfile
? and, follow-up, how should configure dockerfile
/makefile
commands reference correct environment variables within container.
Comments
Post a Comment