[#15] make: Add target for building an image from local binaries

Signed-off-by: Artem Tataurov <a.tataurov@yadro.com>
This commit is contained in:
Artem Tataurov 2023-07-17 17:34:13 +03:00
parent 85d1c6216b
commit c442116c4a
3 changed files with 77 additions and 2 deletions

45
Dockerfile.local Normal file
View file

@ -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"]

View file

@ -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)

View file

@ -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