forked from ethereum/solidity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (32 loc) · 1.45 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
FROM alpine AS build
MAINTAINER chriseth <[email protected]>
#Official solidity docker image
#Establish working directory as solidity
WORKDIR /solidity
# Build dependencies
RUN apk update && apk add boost-dev boost-static build-base cmake git
#Copy working directory on travis to the image
COPY / $WORKDIR
# 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"
#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
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
FROM scratch
COPY --from=build /solidity/solc/solc /usr/bin/solc
ENTRYPOINT ["/usr/bin/solc"]