From c442116c4af33cb7c6108535baa7c1b39223c232 Mon Sep 17 00:00:00 2001 From: Artem Tataurov Date: Mon, 17 Jul 2023 17:34:13 +0300 Subject: [PATCH] [#15] make: Add target for building an image from local binaries Signed-off-by: Artem Tataurov --- Dockerfile.local | 45 +++++++++++++++++++++++++++++++++++++++++++++ Makefile | 10 +++++++++- README.md | 24 +++++++++++++++++++++++- 3 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 Dockerfile.local diff --git a/Dockerfile.local b/Dockerfile.local new file mode 100644 index 0000000..4d403a9 --- /dev/null +++ b/Dockerfile.local @@ -0,0 +1,45 @@ +# Executable image +FROM alpine AS frostfs-aio +RUN apk add --no-cache \ + bash \ + ca-certificates \ + jq \ + expect \ + iputils \ + curl + +WORKDIR / + +COPY ./bin/neo-go /usr/bin/neo-go +COPY ./bin/frostfs-adm /usr/bin/frostfs-adm +COPY ./bin/frostfs-cli /usr/bin/frostfs-cli +COPY ./bin/frostfs-ir /usr/bin/frostfs-ir +COPY ./bin/frostfs-node /usr/bin/frostfs-node +COPY ./bin/frostfs-s3-gw /usr/bin/frostfs-s3-gw +COPY ./bin/frostfs-s3-authmate /usr/bin/frostfs-s3-authmate +COPY ./bin/frostfs-http-gw /usr/bin/frostfs-http-gw + +COPY ./adm/frostfs-adm.yml /config/frostfs-adm.yml +COPY ./ir/cli-cfg.yaml /config/cli-cfg-ir.yaml +COPY ./ir/config.yaml /config/config-ir.yaml +COPY ./morph/protocol.privnet.yml /config/protocol.privnet.yml +COPY ./morph/node-wallet.json /config/alphabet/az.json +COPY ./morph/node-wallet.json /config/node-wallet.json +COPY ./morph/node-config.yaml /config/node-config.yaml +COPY ./http-gw/http-gw-config.yaml /config/http-gw-config.yaml +COPY ./http-gw/http-gw-wallet.json /config/http-gw-wallet.json +COPY ./s3-gw/rules.json /config/bearer-rules.json +COPY ./s3-gw/s3-gw-config.yaml /config/s3-gw-config.yaml +COPY ./s3-gw/s3-gw-wallet.json /config/s3-gw-wallet.json +COPY ./s3-gw/user-wallet.json /config/user-wallet.json +COPY ./sn/cli-cfg.yaml /config/cli-cfg-sn.yaml +COPY ./sn/wallet.json /config/wallet-sn.json +COPY ./sn/config.yaml /config/config-sn.yaml +COPY ./vendor/locode_db /config/locode.db +COPY ./vendor/contracts/ /config/contracts + +COPY ./bin/init-aio.sh /config/bin/init-aio.sh + +ENV AUTHMATE_WALLET_PASSPHRASE="" + +ENTRYPOINT ["/config/bin/init-aio.sh"] diff --git a/Makefile b/Makefile index 3da61e9..2a5c0b0 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ S3_GATE_PUBLIC_KEY ?= "0312fe65b101565de74eedf477afb43417ff5f795732506cfddc8e044 # Build aio Docker image image-aio: - @echo "⇒ Build aio docker image " + @echo "⇒ Build aio docker image" @docker build \ --rm \ --build-arg FROSTFS_HUB_IMAGE=$(FROSTFS_HUB_IMAGE) \ @@ -42,6 +42,14 @@ image-aio: -f Dockerfile \ -t $(AIO_IMAGE):$(AIO_VERSION) . +# Build aio Docker image from all local pre-built binaries +image-aio-local: + @echo "⇒ Build aio docker image from all local pre-built binaries" + @docker build \ + --rm \ + -f Dockerfile.local \ + -t $(AIO_IMAGE):$(AIO_VERSION) . + # Start AIO up: @$(COMPOSE_CMD_UP) diff --git a/README.md b/README.md index 056ab1c..6cca50a 100644 --- a/README.md +++ b/README.md @@ -96,12 +96,34 @@ Waiting for transactions to persist... # Build images -Build frostfs-aio image locally with this command. +## Standard image + +Build frostfs-aio image with this command. ``` sh $ make image-aio ``` +## Image with local binaries + +Put all the needed pre-built binaries to the `frostfs-aio/bin/`: + +- neo-go +- frostfs-adm +- frostfs-cli +- frostfs-ir +- frostfs-node +- frostfs-s3-gw +- frostfs-s3-authmate +- frostfs-http-gw + +Make sure they all have the `x` right for the execution enabled. +Build frostfs-aio image using pre-built local binaries for all the services. + +``` sh +$ make image-aio-local +``` + # Simple storage