Skip to content

Commit

Permalink
feat: rm dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
LinZexiao committed Aug 31, 2022
1 parent d66c22d commit 2994061
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ data-transfer
# vendor/

build-dep
dockerfile
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,8 @@ build: $(BUILD_DEPS)
# docker
.PHONY: docker

TAG:=test
docker:
docker build --build-arg https_proxy=$(BUILD_DOCKER_PROXY) -t venus-market .
curl -O https://raw.githubusercontent.com/filecoin-project/venus-docs/feat/tanlang/improve-docker-usage/script/dockerfile
docker build --build-arg https_proxy=$(BUILD_DOCKER_PROXY) --build-arg BUILD_TARGET=venus-market -t venus-market .
docker tag venus-market filvenus/venus-market:$(TAG)
21 changes: 10 additions & 11 deletions docker/script/init.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#!/bin/sh

echo "Init Begin!"

echo "args:"
echo $@


echo "set default piece storage path: /PieceStorage"
echo "Init Begin!\n"
echo "set default piece storage path: /PieceStorage\n"
mkdir -p ~/.venusmarket/
cat /docker/config/PieceStorage.toml > ~/.venusmarket/config.toml
cat ~/.venusmarket/config.toml
echo "Init End!"
if [ ! -f ~/.venusmarket/config.toml ]; then
echo "set default piece storage path: /PieceStorage"
cat /docker/config/PieceStorage.toml > ~/.venusmarket/config.toml
fi
echo "Init End!\n"

echo "EXEC: ./venus-market $@ \n\n"

/app/venus-market $@
./venus-market $@
19 changes: 13 additions & 6 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
FROM filvenus/venus-buildenv AS buildenv

COPY . ./venus-market
RUN export GOPROXY=https://goproxy.cn && cd venus-market && make deps && make
RUN cd venus-market && ldd ./venus-market
WORKDIR /build

COPY ./go.mod /build/
COPY ./exter[n] ./go.mod /build/extern/
RUN export GOPROXY=https://goproxy.cn,direct && go mod download

COPY . /build
RUN export GOPROXY=https://goproxy.cn,direct && make



FROM filvenus/venus-runtime

ARG BUILD_TARGET=venus-miner

# DIR for app
WORKDIR /app

# copy the app from build env
COPY --from=buildenv /go/venus-market/venus-market /app/venus-market
COPY --from=buildenv /build/${BUILD_TARGET} /app/${BUILD_TARGET}

COPY ./docker/script /script
COPY ./docker /docker


EXPOSE 41235 58418
ENTRYPOINT ["/script/init.sh"]

0 comments on commit 2994061

Please sign in to comment.