Dockerfile: add commit, log format, and make target (#83)

Also fixed `.dockerignore` file and removed unnecessary symlinking.

Related to: https://github.com/status-im/infra-go-waku

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub 2021-10-15 12:47:23 +02:00 committed by GitHub
parent c86db00285
commit 21aba7cd65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 15 deletions

View File

@ -1,7 +1,7 @@
/README.md
/Dockerfile
/.*ignore
/LICENSE*
/tests
/examples
/*.db
README.md
Dockerfile
.*ignore
LICENSE*
tests
examples
*.db

View File

@ -8,24 +8,27 @@ WORKDIR /app
COPY . .
# Build the final node binary
RUN make -j$(nproc) $MAKE_TARGET
RUN make -j$(nproc) build
# ACTUAL IMAGE -------------------------------------------------------
FROM alpine:3.12
ARG GIT_COMMIT=unknown
LABEL maintainer="richard@status.im"
LABEL source="https://github.com/status-im/go-waku"
LABEL description="go-waku: Waku V2 node"
LABEL commit=$GIT_COMMIT
# color, nocolor, json
ENV GOLOG_LOG_FMT=nocolor
# go-waku default port
EXPOSE 9000
EXPOSE 9000
COPY --from=builder /app/build/waku /usr/local/bin/
# Symlink the correct wakunode binary
RUN ln -sv /usr/local/bin/waku /usr/bin/waku
COPY --from=builder /app/build/waku /usr/bin/waku
ENTRYPOINT ["/usr/bin/waku"]
# By default just show help if called without arguments
CMD ["--help"]
CMD ["--help"]

View File

@ -22,4 +22,11 @@ test:
go test -v -failfast ./...
generate:
go generate ./waku/v2/protocol/pb/generate.go
go generate ./waku/v2/protocol/pb/generate.go
# build a docker image for the fleet
docker-image: DOCKER_IMAGE_TAG ?= latest
docker-image: DOCKER_IMAGE_NAME ?= statusteam/go-waku:$(DOCKER_IMAGE_TAG)
docker-image:
docker build --tag $(DOCKER_IMAGE_NAME) \
--build-arg="GIT_COMMIT=$(shell git rev-parse HEAD)" .