From 65434fa49a0a4fb0b129e7273e5da41df8d73b5b Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Tue, 23 Oct 2018 12:00:42 +0200 Subject: [PATCH] docker: fix Docker build --- Dockerfile | 28 ++++++++++++++++------------ build-docker.sh | 4 +++- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index a9a9d8e562..d77de60240 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,12 +12,13 @@ RUN apt-get update && apt-get install -y \ # install dependencies from toolchain source build -RUN [ "$TOOLCHAIN_FLAVOR" = "src" ] && \ - apt-get install -y autoconf autogen bison dejagnu \ - flex flip gawk git gperf gzip nsis \ - openssh-client p7zip-full perl python-dev \ - libisl-dev tcl tofrodos zip \ - texinfo texlive texlive-extra-utils +RUN if [ "$TOOLCHAIN_FLAVOR" = "src" ]; then \ + apt-get install -y autoconf autogen bison dejagnu \ + flex flip gawk git gperf gzip nsis \ + openssh-client p7zip-full perl python-dev \ + libisl-dev tcl tofrodos zip \ + texinfo texlive texlive-extra-utils; \ + fi # download toolchain @@ -31,9 +32,13 @@ RUN cd /opt && wget $TOOLCHAIN_URL && tar xfj $TOOLCHAIN_LONGVER-$TOOLCHAIN_FLAV # build toolchain (if required) -RUN [ "$TOOLCHAIN_FLAVOR" = "src" ] && cd /opt/$TOOLCHAIN_LONGVER && ./install-sources.sh --skip_steps=mingw32 -RUN [ "$TOOLCHAIN_FLAVOR" = "src" ] && cd /opt/$TOOLCHAIN_LONGVER && ./build-prerequisites.sh --skip_steps=mingw32 -RUN [ "$TOOLCHAIN_FLAVOR" = "src" ] && cd /opt/$TOOLCHAIN_LONGVER && ./build-toolchain.sh --skip_steps=mingw32,manual +RUN if [ "$TOOLCHAIN_FLAVOR" = "src" ]; then \ + pushd /opt/$TOOLCHAIN_LONGVER ; \ + ./install-sources.sh --skip_steps=mingw32 ; \ + ./build-prerequisites.sh --skip_steps=mingw32 ; \ + ./build-toolchain.sh --skip_steps=mingw32,manual ; \ + popd ; \ + fi # install additional tools @@ -43,10 +48,9 @@ RUN apt-get install -y protobuf-compiler libprotobuf-dev ENV PATH=/opt/$TOOLCHAIN_LONGVER/bin:$PATH -# install python tools +# install python dependencies -RUN pip3 install click pyblake2 scons protobuf -RUN pip3 install --no-deps git+https://github.com/trezor/python-trezor.git@master +RUN pip3 install scons trezor # workarounds for weird default install diff --git a/build-docker.sh b/build-docker.sh index 5fa7fed779..c513beaad6 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -20,7 +20,9 @@ fi docker build -t $IMAGE --build-arg TOOLCHAIN_FLAVOR=$TOOLCHAIN_FLAVOR . -docker run -t -v $(pwd):/local -v $(pwd)/build-docker:/build:z $IMAGE /bin/sh -c "\ +mkdir -p $(pwd)/build-docker +docker run -t -v $(pwd):/local -v $(pwd)/build-docker:/build:z --user="$(stat -c "%u:%g" .)" $IMAGE /bin/sh -c "\ + cd /tmp && \ git clone $REPOSITORY trezor-core && \ cd trezor-core && \ ln -s /build build &&