Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
FROM golang:1.23 AS build

ARG REACHABILITY_OVERRIDE_PUBLIC=false
ARG BATCHFACTOR_OVERRIDE_PUBLIC=5

WORKDIR /src
# enable modules caching in separate layer
COPY go.mod go.sum ./
RUN go mod download
COPY . ./

RUN make binary \
REACHABILITY_OVERRIDE_PUBLIC=${REACHABILITY_OVERRIDE_PUBLIC} \
BATCHFACTOR_OVERRIDE_PUBLIC=${BATCHFACTOR_OVERRIDE_PUBLIC}

FROM debian:12.7-slim

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates; \
ca-certificates; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*; \
groupadd -r bee --gid 999; \
Expand All @@ -12,7 +27,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
# make sure mounted volumes have correct permissions
RUN mkdir -p /home/bee/.bee && chown 999:999 /home/bee/.bee

COPY ./tmp/bee /usr/local/bin/bee
COPY --from=build /src/dist/bee /usr/local/bin/bee

EXPOSE 1633 1634
USER bee
Expand Down
14 changes: 8 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ BEEKEEPER_BRANCH ?= master
REACHABILITY_OVERRIDE_PUBLIC ?= false
BATCHFACTOR_OVERRIDE_PUBLIC ?= 5
BEE_IMAGE ?= ethersphere/bee:latest
PLATFORM ?= linux/amd64

BEE_API_VERSION ?= "$(shell grep '^ version:' openapi/Swarm.yaml | awk '{print $$2}')"

Expand Down Expand Up @@ -142,13 +143,14 @@ build: export CGO_ENABLED=0
build:
$(GO) build -trimpath -ldflags "$(LDFLAGS)" ./...

# example: make docker-build PLATFORM=linux/amd64 BEE_IMAGE=ethersphere/bee:latest REACHABILITY_OVERRIDE_PUBLIC=false BATCHFACTOR_OVERRIDE_PUBLIC=5
.PHONY: docker-build
docker-build: binary
@echo "Build flags: $(LDFLAGS)"
mkdir -p ./tmp
cp ./dist/bee ./tmp/bee
docker build -f Dockerfile.dev -t $(BEE_IMAGE) . --no-cache
rm -rf ./tmp
docker-build:
docker build -f Dockerfile.dev \
--platform $(PLATFORM) \
-t $(BEE_IMAGE) . \
--build-arg REACHABILITY_OVERRIDE_PUBLIC=$(REACHABILITY_OVERRIDE_PUBLIC) \
--build-arg BATCHFACTOR_OVERRIDE_PUBLIC=$(BATCHFACTOR_OVERRIDE_PUBLIC)
@echo "Docker image: $(BEE_IMAGE)"

.PHONY: githooks
Expand Down
Loading