Add a Dockerfile, installer.sh and ligo.sh for easy ligo usage with Docker
This commit is contained in:
parent
0b6f0e03be
commit
c9703bdceb
31
docker/Dockerfile
Normal file
31
docker/Dockerfile
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
# We could use one of the nomadiclab's docker images as a base instead
|
||||||
|
# We're using 4.06 instead of 4.06.1, if this causes problems built a custom 4.06.1 image instead
|
||||||
|
FROM ocaml/opam2:4.06
|
||||||
|
|
||||||
|
USER root
|
||||||
|
|
||||||
|
# Setup a custom opam repository where ligo is published
|
||||||
|
RUN git clone https://gitlab.com/gabriel.alfour/ligo-opam-repository
|
||||||
|
RUN opam repo add ligo-opam-repository ./ligo-opam-repository
|
||||||
|
RUN opam update ligo-opam-repository
|
||||||
|
|
||||||
|
# Install required native dependencies
|
||||||
|
RUN apt-get -y install \
|
||||||
|
libev-dev \
|
||||||
|
perl \
|
||||||
|
pkg-config \
|
||||||
|
libgmp-dev \
|
||||||
|
libhidapi-dev \
|
||||||
|
m4
|
||||||
|
|
||||||
|
# Install ligo
|
||||||
|
RUN git clone https://gitlab.com/gabriel.alfour/ligo
|
||||||
|
RUN opam update
|
||||||
|
|
||||||
|
RUN cd ligo/src && \
|
||||||
|
opam install . --yes
|
||||||
|
|
||||||
|
RUN eval $(opam env)
|
||||||
|
|
||||||
|
# Use the ligo binary as a default command
|
||||||
|
ENTRYPOINT [ "/home/opam/.opam/4.06/bin/ligo" ]
|
16
docker/installer.sh
Normal file
16
docker/installer.sh
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# You can run this installer like this:
|
||||||
|
# curl https://gitlab.com/gabriel.alfour/ligo/blob/master/docker/installer.sh | bash
|
||||||
|
# Make sure the marigold/ligo image is published at docker hub first
|
||||||
|
echo "Installing LIGO"
|
||||||
|
|
||||||
|
# Install the ligo.sh from master
|
||||||
|
wget https://gitlab.com/gabriel.alfour/ligo/blob/master/docker/ligo.sh
|
||||||
|
|
||||||
|
# Copy the exucutable to the appropriate directory
|
||||||
|
sudo cp ligo.sh /usr/local/bin/ligo
|
||||||
|
sudo chmod +x /usr/local/bin/ligo
|
||||||
|
rm ligo.sh
|
||||||
|
|
||||||
|
# Installation finished, try running 'ligo' from your CLI
|
||||||
|
echo "Installation successfull, try running 'ligo' now. \n"
|
2
docker/ligo.sh
Normal file
2
docker/ligo.sh
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
docker run -it -v $PWD:$PWD -w $PWD marigold/ligo $@
|
Loading…
Reference in New Issue
Block a user