2018-06-21 14:54:48 +00:00
|
|
|
FROM alpine AS build
|
2016-11-24 20:48:16 +00:00
|
|
|
MAINTAINER chriseth <chris@ethereum.org>
|
2017-02-03 00:53:30 +00:00
|
|
|
#Official solidity docker image
|
2016-11-24 20:48:16 +00:00
|
|
|
|
2017-02-03 00:53:30 +00:00
|
|
|
#Establish working directory as solidity
|
|
|
|
WORKDIR /solidity
|
2018-06-21 14:54:48 +00:00
|
|
|
|
|
|
|
# Build dependencies
|
|
|
|
ADD /scripts/install_deps.sh /solidity/scripts/install_deps.sh
|
|
|
|
RUN ./scripts/install_deps.sh
|
|
|
|
|
2017-02-03 00:53:30 +00:00
|
|
|
#Copy working directory on travis to the image
|
|
|
|
COPY / $WORKDIR
|
|
|
|
|
2018-06-22 07:27:08 +00:00
|
|
|
# Number of parallel jobs during build
|
|
|
|
# or 0 for auto-computing (max(1, CPU_core_count * 2/3), a greedy value)
|
|
|
|
ARG BUILD_CONCURRENCY="0"
|
|
|
|
|
2018-06-21 14:54:48 +00:00
|
|
|
#Install dependencies, eliminate annoying warnings
|
|
|
|
RUN sed -i -E -e 's/include <sys\/poll.h>/include <poll.h>/' /usr/include/boost/asio/detail/socket_types.hpp
|
|
|
|
RUN cmake -DCMAKE_BUILD_TYPE=Release -DTESTS=0 -DSOLC_LINK_STATIC=1
|
2018-06-22 07:27:08 +00:00
|
|
|
RUN make solc \
|
|
|
|
-j$(awk "BEGIN { \
|
|
|
|
if (${BUILD_CONCURRENCY} != 0) { \
|
|
|
|
print(${BUILD_CONCURRENCY}); \
|
|
|
|
} else { \
|
|
|
|
x=($(grep -c ^processor /proc/cpuinfo) * 2/3); \
|
|
|
|
if (x > 1) { \
|
|
|
|
printf(\"%d\n\", x); \
|
|
|
|
} else { \
|
|
|
|
print(1); \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
}")
|
|
|
|
RUN strip solc/solc
|
2017-03-16 17:13:34 +00:00
|
|
|
|
2018-06-21 14:54:48 +00:00
|
|
|
FROM scratch
|
|
|
|
COPY --from=build /solidity/solc/solc /usr/bin/solc
|
|
|
|
ENTRYPOINT ["/usr/bin/solc"]
|