I used such Dockerfile
to build a storagenode:
FROM --platform=linux/arm/v5 golang:1.17-alpine as build
# RUN apt update && apt dist-upgrade -y && apt install npm -y
RUN apk add npm git bash gcc libc-dev
RUN git clone https://github.com/storj/storj.git && cd storj && git checkout v1.39.6
RUN cd storj/web/storagenode && npm install && npm run build && cd ../.. \
&& go get github.com/go-bindata/go-bindata/go-bindata \
&& go-bindata -prefix web/storagenode/ -fs -o storagenode/console/consoleassets/bindata.resource.go -pkg consoleassets web/storagenode/dist/... web/storagenode/static/... \
&& /usr/bin/env echo -e '\nfunc init() { FileSystem = AssetFile() }' >> storagenode/console/consoleassets/bindata.resource.go \
&& gofmt -w -s storagenode/console/consoleassets/bindata.resource.go \
&& git checkout .
RUN cd storj && ./scripts/release.sh install ./cmd/storagenode
FROM --platform=linux/arm/v5 alpine
RUN apk add libc6-compat
WORKDIR /app
COPY --from=build /go/bin/storagenode /app/storagenode
COPY --from=build /go/storj/cmd/storagenode/dashboard.sh /app/
COPY --from=build /go/storj/cmd/storagenode/entrypoint /
EXPOSE 28967
EXPOSE 14002
ENTRYPOINT [ "/entrypoint" ]
And this docker-compose.yaml
to build and run it:
version: "3.7"
services:
storagenode6:
container_name: storagenode6
restart: always
stop_grace_period: 300s
image: storagenode:arm
build: .
ports:
- "28971:28967/tcp"
- "28971:28967/udp"
- "14006:14002"
volumes:
- type: bind
source: /mnt/storj/storagenode6/identity/
target: /app/identity
- type: bind
source: /mnt/storj/storagenode6/
target: /app/config
environment:
- WALLET=0x000...
- EMAIL=email
- ADDRESS=external.address:28971
- STORAGE=500GB
command:
- "--operator.wallet-features=zksync"
- "--storage2.trust.sources=https://www.storj.io/dcs-satellites"
# - "--log.level=info"
# - "--log.development=false"
# - "--log.caller=false"
So you can try to do it like this:
git clone https://github.com/storj/storj.git
cd storj
git checkout v1.39.6
cd web/storagenode
npm install
npm build
cd -
go get github.com/go-bindata/go-bindata/go-bindata
go-bindata -prefix web/storagenode/ -fs -o storagenode/console/consoleassets/bindata.resource.go -pkg consoleassets web/storagenode/dist/... web/storagenode/static/...
/usr/bin/env echo -e '\nfunc init() { FileSystem = AssetFile() }' >> storagenode/console/consoleassets/bindata.resource.go
gofmt -w -s storagenode/console/consoleassets/bindata.resource.go
git checkout .
./scripts/release.sh install ./cmd/storagenode
in ../bin
you would have a binary