Dockerfile improvement (#1017)

* build(dockerfile): support preinstalling custom solc

* build(dockerfile): run with normal user mythril

* build(dockerfile): fix install SOLC command & install under mythril user

* fix.build(dockerfile): when build-time argument SOLC not specified

* fix.build & chore(dockerfile): copy signature db to user directory & remove CHOWN operation for copied files

Fix copying to `signatures.db` to root home directory mistake. `chown` operation was unnecessary and removed.
pull/1039/head
Xiao Liang 6 years ago committed by Nikhil Parasaram
parent a9671de8a3
commit 111f1f166f
  1. 12
      Dockerfile

@ -1,5 +1,8 @@
FROM ubuntu:bionic FROM ubuntu:bionic
# Space-separated version string without leading 'v' (e.g. "0.4.21 0.4.22")
ARG SOLC
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y \ && apt-get install -y \
libsqlite3-0 \ libsqlite3-0 \
@ -36,5 +39,12 @@ COPY . /opt/mythril
RUN cd /opt/mythril \ RUN cd /opt/mythril \
&& python setup.py install && python setup.py install
COPY ./mythril/support/assets/signatures.db /root/.mythril/signatures.db RUN useradd -m mythril
USER mythril
WORKDIR /home/mythril
RUN ( [ ! -z "${SOLC}" ] && set -e && for ver in $SOLC; do python -m solc.install v${ver}; done ) || true
COPY ./mythril/support/assets/signatures.db /home/mythril/.mythril/signatures.db
ENTRYPOINT ["/usr/local/bin/myth"] ENTRYPOINT ["/usr/local/bin/myth"]

Loading…
Cancel
Save