This repository has been archived by the owner on Feb 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update Dockerfile to use pre-compiled binnary v1.11.0 (closes #713)
- Loading branch information
1 parent
6b30fa2
commit 9615bc9
Showing
2 changed files
with
31 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,32 @@ | ||
FROM golang:1.12.7 | ||
FROM ubuntu:20.04 | ||
|
||
LABEL maintainer="Nikhil Saraf <Github: @nikhilsaraf>" | ||
|
||
# install yarn | ||
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - | ||
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list | ||
RUN apt update | ||
RUN apt -y install yarn | ||
# add dependencies: curl, unzip | ||
RUN apt-get update && apt-get install -y curl unzip | ||
|
||
# set working dir | ||
WORKDIR /go/src/github.com/stellar/kelp | ||
RUN pwd | ||
# fetch ccxt-rest | ||
RUN mkdir -p /root/.kelp/ccxt | ||
RUN curl -L https://github.com/stellar/kelp/releases/download/ccxt-rest_v0.0.4/ccxt-rest_linux-x64.zip -o /root/.kelp/ccxt/ccxt-rest_linux-x64.zip | ||
RUN unzip /root/.kelp/ccxt/ccxt-rest_linux-x64.zip -d /root/.kelp/ccxt | ||
|
||
# install glide | ||
RUN curl -s https://glide.sh/get | sh | ||
|
||
# install kelp | ||
ENV GOPATH /go | ||
RUN git clone https://github.com/stellar/kelp.git . | ||
RUN git fetch --tags | ||
RUN glide install | ||
RUN ./scripts/build.sh | ||
# fetch kelp archive | ||
RUN curl -L https://github.com/stellar/kelp/releases/download/v1.11.0/kelp-v1.11.0-linux-amd64.tar -o kelp-archive.tar | ||
# extract | ||
RUN tar xvf kelp-archive.tar | ||
# set working directory | ||
WORKDIR kelp-v1.11.0 | ||
|
||
# set ulimit | ||
RUN ulimit -n 10000 | ||
|
||
# start ccxt-rest when container is started | ||
CMD nohup /root/.kelp/ccxt/ccxt-rest_linux-x64/ccxt-rest > ~/ccxt-rest.log & | ||
|
||
# use command line arguments from invocation of docker run against this ENTRYPOINT command - https://stackoverflow.com/a/40312311/1484710 | ||
ENTRYPOINT ["./bin/kelp"] | ||
ENTRYPOINT ["./kelp"] | ||
# default arguments are empty | ||
CMD [""] | ||
|
||
# sample command to run this container as a daemon process: | ||
# docker run -v `pwd`/ops:/go/src/github.com/stellar/kelp/bin/ops -d -p 8011:8011 <image> server -p 8011 --ccxt-rest-url=http://host.docker.internal:3000 | ||
# this assumes that you are running ccxt on port 3000 outside this kelp docker container | ||
# the three port numbers (8011 in the example above) must be the same and must be specified | ||
# the first part of the -v argument is the directory where you want to save the kelp configs and kelp logs from the bots created in this container | ||
# sample command to run this container: | ||
# docker run nikhilsaraf/kelp:latest trade -c sample_trader.cfg -s buysell -f sample_buysell.cfg --sim |