Adds the AMD64 and ARM Storagenode Dockerfiles and setup scripts (#1544)

* add alpha dockerfile structure

* adds Stefans satelitte to white list
This commit is contained in:
Dennis Coyle 2019-04-03 16:17:55 -04:00 committed by JT Olio
parent 2cf86703a3
commit 88f0d63f33
5 changed files with 101 additions and 0 deletions

View File

@ -0,0 +1,42 @@
# build
FROM golang:1.11-alpine as build-env
ENV CGO_ENABLED=1
ADD . /go/src/storj.io/storj
WORKDIR /go/src/storj.io/storj/cmd/storagenode
# dependencies + binary
RUN apk add git gcc musl-dev
#RUN unset GOPATH && go mod vendor
RUN go build -a -installsuffix cgo -o storagenode .
RUN mkdir config identity
# final stage
FROM alpine
EXPOSE 28967
ENV STORJ_KADEMLIA_BOOTSTRAP_ADDR="bootstrap.storj.io:8888"
ENV STORJ_METRICS_APP_SUFFIX="-alpha"
ENV STORJ_METRICS_INTERVAL="30m"
ENV STORJ_SERVER_USE_PEER_CA_WHITELIST="true"
ENV ADDRESS=""
ENV EMAIL=""
ENV WALLET=""
ENV BANDWIDTH="2.0TB"
ENV STORAGE="2.0TB"
WORKDIR /app
COPY --from=build-env /go/src/storj.io/storj/cmd/storagenode/storagenode /app/
COPY --from=build-env /go/src/storj.io/storj/cmd/storagenode/config /app/
COPY --from=build-env /go/src/storj.io/storj/cmd/storagenode/identity /app/
COPY --from=build-env /go/src/storj.io/storj/cmd/storagenode/alpha/entrypoint.sh /app/
COPY --from=build-env /go/src/storj.io/storj/cmd/storagenode/alpha/dashboard.sh /app/
RUN ls -l /app
ENTRYPOINT ["./entrypoint.sh"]
#ENTRYPOINT ./storagenode run --config-dir="/app/config" --identity-dir="/app/identity" --kademlia.external-address=${ADDRESS} --kademlia.operator.email=${EMAIL} --kademlia.operator.wallet=${WALLET}

View File

@ -0,0 +1,27 @@
# build
FROM golang:1.11-alpine as build-env
ADD . /go/src/storj.io/storj
WORKDIR /go/src/storj.io/storj/cmd/storagenode
RUN mkdir config
# final stage
FROM alpine
EXPOSE 28967
ENV STORJ_KADEMLIA_BOOTSTRAP_ADDR="bootstrap.storj.io:8888"
ENV STORJ_METRICS_APP_SUFFIX="-alpha"
ENV STORJ_METRICS_INTERVAL="30m"
ENV STORJ_SERVER_USE_PEER_CA_WHITELIST="true"
ENV COMMAND="run"
WORKDIR /app
COPY --from=build-env /go/src/storj.io/storj/storagenode_linux_arm /app
COPY --from=build-env /go/src/storj.io/storj/cmd/storagenode/config /app/
ENTRYPOINT ./storagenode $COMMAND --config-dir="config"

View File

@ -0,0 +1,3 @@
#!/bin/sh
./storagenode dashboard --config-dir /app/config --identity-dir /app/identity $@

View File

@ -0,0 +1,22 @@
#!/bin/sh
set -euo pipefail
if [[ ! -f "config/config.yaml" ]]; then
./storagenode setup --config-dir config --identity-dir identity
fi
RUN_PARAMS="${RUN_PARAMS:-} --config-dir config"
RUN_PARAMS="${RUN_PARAMS:-} --identity-dir identity"
RUN_PARAMS="${RUN_PARAMS:-} --kademlia.bootstrap-addr=bootstrap.storj.io:8888"
RUN_PARAMS="${RUN_PARAMS:-} --metrics.app-suffix=-alpha"
RUN_PARAMS="${RUN_PARAMS:-} --metrics.interval=30m"
RUN_PARAMS="${RUN_PARAMS:-} --server.use-peer-ca-whitelist=true"
RUN_PARAMS="${RUN_PARAMS:-} --kademlia.external-address=${ADDRESS}"
RUN_PARAMS="${RUN_PARAMS:-} --kademlia.operator.email=${EMAIL}"
RUN_PARAMS="${RUN_PARAMS:-} --kademlia.operator.wallet=${WALLET}"
RUN_PARAMS="${RUN_PARAMS:-} --storage.allocated-bandwidth=${BANDWIDTH}"
RUN_PARAMS="${RUN_PARAMS:-} --storage.allocated-disk-space=${STORAGE}"
RUN_PARAMS="${RUN_PARAMS:-} --storage.whitelisted-satellite-i-ds=12EayRS2V1kEsWESU9QMRseFhdxYxKicsiFmxrsLZHeLUtdps3S,1Vrf9xmmHw6KaVFMcfR2YPt8YpVVoQZGTUJyjYc6CajeYrAqrB,118UWpMCHzs6CvSgWd9BfFVjw5K9pZbJjkfZJexMtSkmKxvvAW"
exec ./storagenode run $RUN_PARAMS "$@"

7
cmd/storagenode/alpha/setup.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
set -euo pipefail
if [[ ! -f "config/config.yaml" ]]; then
./storagenode setup --config-dir config --identity-dir /app/identity
fi