diff --git a/.circleci/config.yml b/.circleci/config.yml
index 478c84500..2c972f0ff 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -628,6 +628,11 @@ jobs:
default: "latest"
description: A comma-separated string containing docker image tags to build and push (default = latest)
+ target:
+ type: string
+ default: "lotus-all-in-one"
+ description: Docker target to build
+
steps:
- run:
name: Confirm that environment variables are set
@@ -667,6 +672,7 @@ jobs:
docker build \
<<#parameters.extra-build-args>><><> \
+ --target <> \
-f <>/<> \
$docker_tag_args \
<>
@@ -1037,6 +1043,13 @@ workflows:
path: .
repo: lotus-dev
tag: '${CIRCLE_SHA1:0:8}'
+ target: lotus-all-in-one
+ - build-and-push-image:
+ dockerfile: Dockerfile.lotus
+ path: .
+ repo: lotus-test
+ tag: '${CIRCLE_SHA1:0:8}'
+ target: lotus-test
- publish-packer-mainnet:
requires:
- build-all
diff --git a/.circleci/template.yml b/.circleci/template.yml
index c8643e3ac..dc3b37f2d 100644
--- a/.circleci/template.yml
+++ b/.circleci/template.yml
@@ -628,6 +628,11 @@ jobs:
default: "latest"
description: A comma-separated string containing docker image tags to build and push (default = latest)
+ target:
+ type: string
+ default: "lotus-all-in-one"
+ description: Docker target to build
+
steps:
- run:
name: Confirm that environment variables are set
@@ -667,6 +672,7 @@ jobs:
docker build \
<<#parameters.extra-build-args>><><> \
+ --target <> \
-f <>/<> \
$docker_tag_args \
<>
@@ -862,6 +868,13 @@ workflows:
path: .
repo: lotus-dev
tag: '${CIRCLE_SHA1:0:8}'
+ target: lotus-all-in-one
+ - build-and-push-image:
+ dockerfile: Dockerfile.lotus
+ path: .
+ repo: lotus-test
+ tag: '${CIRCLE_SHA1:0:8}'
+ target: lotus-test
- publish-packer-mainnet:
requires:
- build-all
diff --git a/Dockerfile.lotus b/Dockerfile.lotus
index 48a68ef6f..4609ff9a2 100644
--- a/Dockerfile.lotus
+++ b/Dockerfile.lotus
@@ -28,6 +28,14 @@ WORKDIR /opt/filecoin
RUN make clean deps
+FROM builder-local AS builder-test
+MAINTAINER Lotus Development Team
+
+WORKDIR /opt/filecoin
+
+RUN make debug
+
+
FROM builder-local AS builder
MAINTAINER Lotus Development Team
@@ -198,6 +206,43 @@ RUN chown fc: /var/lib/lotus-worker
RUN chown fc: /var/lib/lotus-wallet
+VOLUME /var/tmp/filecoin-proof-parameters
+VOLUME /var/lib/lotus
+VOLUME /var/lib/lotus-miner
+VOLUME /var/lib/lotus-worker
+VOLUME /var/lib/lotus-wallet
+
+EXPOSE 1234
+EXPOSE 2345
+EXPOSE 3456
+EXPOSE 1777
+
+###
+from base as lotus-test
+
+ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
+ENV LOTUS_MINER_PATH /var/lib/lotus-miner
+ENV LOTUS_PATH /var/lib/lotus
+ENV LOTUS_WORKER_PATH /var/lib/lotus-worker
+ENV WALLET_PATH /var/lib/lotus-wallet
+
+COPY --from=builder-test /opt/filecoin/lotus /usr/local/bin/
+COPY --from=builder-test /opt/filecoin/lotus-miner /usr/local/bin/
+COPY --from=builder-test /opt/filecoin/lotus-worker /usr/local/bin/
+COPY --from=builder-test /opt/filecoin/lotus-seed /usr/local/bin/
+
+RUN mkdir /var/tmp/filecoin-proof-parameters
+RUN mkdir /var/lib/lotus
+RUN mkdir /var/lib/lotus-miner
+RUN mkdir /var/lib/lotus-worker
+RUN mkdir /var/lib/lotus-wallet
+RUN chown fc: /var/tmp/filecoin-proof-parameters
+RUN chown fc: /var/lib/lotus
+RUN chown fc: /var/lib/lotus-miner
+RUN chown fc: /var/lib/lotus-worker
+RUN chown fc: /var/lib/lotus-wallet
+
+
VOLUME /var/tmp/filecoin-proof-parameters
VOLUME /var/lib/lotus
VOLUME /var/lib/lotus-miner