Docker: fix leveldb installation

This commit is contained in:
Grégoire Henry 2017-11-20 01:11:22 +01:00 committed by Grégoire
parent ac62538eb6
commit 5bcb2593a3

View File

@ -3,11 +3,11 @@
FROM alpine:$alpine_version FROM alpine:$alpine_version
RUN apk update && apk upgrade && \ RUN apk update && apk upgrade && \
apk add build-base snappy-dev abuild \ apk add build-base snappy-dev abuild alpine-sdk \
alpine-sdk openssh bash nano ncurses-dev rsync xz m4 \ openssh bash nano ncurses-dev rsync xz m4 \
opam aspcud \ opam aspcud \
gmp-dev libev-dev libressl-dev linux-headers pcre-dev perl zlib-dev \ gmp-dev libev-dev libressl-dev linux-headers pcre-dev perl zlib-dev \
libsodium-dev snappy-dev && \ libsodium-dev && \
rm -f /var/cache/apk/* && \ rm -f /var/cache/apk/* && \
adduser -S opam && \ adduser -S opam && \
adduser opam abuild && \ adduser opam abuild && \
@ -20,13 +20,6 @@ USER opam
WORKDIR /home/opam WORKDIR /home/opam
COPY scripts/leveldb-1.18.APKBUILD /home/opam/leveldb-1.18/APKBUILD
RUN sudo chown -R opam leveldb-1.18
RUN abuild-keygen -a && \
cd leveldb-1.18 && \
abuild checksum && abuild -r
RUN mkdir .ssh && \ RUN mkdir .ssh && \
chmod 700 .ssh && \ chmod 700 .ssh && \
git config --global user.email "docker@example.com" && \ git config --global user.email "docker@example.com" && \
@ -35,6 +28,19 @@ RUN mkdir .ssh && \
sudo -u opam sh -c "opam init -a -y --comp $ocaml_version /home/opam/opam-repository" && \ sudo -u opam sh -c "opam init -a -y --comp $ocaml_version /home/opam/opam-repository" && \
sudo -u opam sh -c "opam install -y depext travis-opam" sudo -u opam sh -c "opam install -y depext travis-opam"
COPY scripts/leveldb-1.18.APKBUILD /home/opam/leveldb-1.18/APKBUILD
RUN sudo chown -R opam leveldb-1.18
RUN sudo apk update && \
abuild-keygen -ai && \
cd leveldb-1.18 && \
abuild checksum && abuild -r && \
cd .. && \
sudo apk add packages/opam/x86_64/leveldb-1.18-r0.apk && \
sudo apk add packages/opam/x86_64/leveldb-dev-1.18-r0.apk && \
rm -rf leveldb-1.18 packages && \
sudo rm -f /var/cache/apk/*
ENTRYPOINT [ "opam", "config", "exec", "--" ] ENTRYPOINT [ "opam", "config", "exec", "--" ]
CMD [ "sh" ] CMD [ "sh" ]