Skip to content

Commit be17cd2

Browse files
chore: add docker-build target to Makefile with support for configurable build flags (#4893)
1 parent ef966b1 commit be17cd2

File tree

7 files changed

+39
-7
lines changed

7 files changed

+39
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/dist
22
/.idea
33
/.vscode
4+
/tmp
45

56
# Compiled Object files, Static and Dynamic libs (Shared Objects)
67
*.o

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ RUN make binary
1010

1111
FROM debian:12.7-slim
1212

13-
ENV DEBIAN_FRONTEND noninteractive
13+
ENV DEBIAN_FRONTEND=noninteractive
1414

1515
RUN apt-get update && apt-get install -y --no-install-recommends \
1616
ca-certificates; \

Dockerfile.dev

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM debian:12.7-slim
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
5+
RUN apt-get update && apt-get install -y --no-install-recommends \
6+
ca-certificates; \
7+
apt-get clean; \
8+
rm -rf /var/lib/apt/lists/*; \
9+
groupadd -r bee --gid 999; \
10+
useradd -r -g bee --uid 999 --no-log-init -m bee;
11+
12+
# make sure mounted volumes have correct permissions
13+
RUN mkdir -p /home/bee/.bee && chown 999:999 /home/bee/.bee
14+
15+
COPY ./tmp/bee /usr/local/bin/bee
16+
17+
EXPOSE 1633 1634
18+
USER bee
19+
WORKDIR /home/bee
20+
VOLUME /home/bee/.bee
21+
22+
ENTRYPOINT ["bee"]

Dockerfile.goreleaser

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM debian:12.7-slim
22

3-
ENV DEBIAN_FRONTEND noninteractive
3+
ENV DEBIAN_FRONTEND=noninteractive
44

55
RUN apt-get update && apt-get install -y --no-install-recommends \
66
ca-certificates; \

Dockerfile.scratch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM debian:12.7-slim
22

3-
ENV DEBIAN_FRONTEND noninteractive
3+
ENV DEBIAN_FRONTEND=noninteractive
44

55
RUN apt-get update && apt-get install -y --no-install-recommends \
66
ca-certificates; \

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ BEELOCAL_BRANCH ?= main
1111
BEEKEEPER_BRANCH ?= master
1212
REACHABILITY_OVERRIDE_PUBLIC ?= false
1313
BATCHFACTOR_OVERRIDE_PUBLIC ?= 5
14+
BEE_IMAGE ?= ethersphere/bee:latest
1415

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

@@ -141,6 +142,15 @@ build: export CGO_ENABLED=0
141142
build:
142143
$(GO) build -trimpath -ldflags "$(LDFLAGS)" ./...
143144

145+
.PHONY: docker-build
146+
docker-build: binary
147+
@echo "Build flags: $(LDFLAGS)"
148+
mkdir -p ./tmp
149+
cp ./dist/bee ./tmp/bee
150+
docker build -f Dockerfile.dev -t $(BEE_IMAGE) . --no-cache
151+
rm -rf ./tmp
152+
@echo "Docker image: $(BEE_IMAGE)"
153+
144154
.PHONY: githooks
145155
githooks:
146156
ln -f -s ../../.githooks/pre-push.bash .git/hooks/pre-push

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,22 @@
99
![GitHub all releases](https://img.shields.io/github/downloads/ethersphere/bee/total)
1010
![GitHub](https://img.shields.io/github/license/ethersphere/bee)
1111

12-
1312
## DISCLAIMER
13+
1414
This software is provided to you "as is", use at your own risk and without warranties of any kind.
1515
It is your responsibility to read and understand how Swarm works and the implications of running this software.
1616
The usage of Bee involves various risks, including, but not limited to:
1717
damage to hardware or loss of funds associated with the Ethereum account connected to your node.
1818
No developers or entity involved will be liable for any claims and damages associated with your use,
1919
inability to use, or your interaction with other nodes or the software.
2020

21-
Our documentation is hosted at https://docs.ethswarm.org.
21+
Our documentation is hosted at <https://docs.ethswarm.org>.
2222

2323
## Versioning
2424

2525
There are two versioning schemes used in Bee that you should be aware of. The main Bee version does **NOT** follow
2626
strict Semantic Versioning. Bee hosts different peer-to-peer wire protocol implementations and individual protocol breaking changes would necessitate a bump in the major part of the version. Breaking changes are expected with bumps of the minor version component. New (backward-compatible) features and bug fixes are expected with a bump of the patch component. Major version bumps are reserved for significant changes in Swarm's incentive structure.
2727

28-
2928
The second is the Bee's API version (denoted in our [Bee](https://github.com/ethersphere/bee/blob/master/openapi/Swarm.yaml) OpenAPI specifications). This version **follows**
3029
Semantic Versioning and hence you should follow these for breaking changes.
3130

@@ -38,8 +37,8 @@ Please read the [coding guidelines](CODING.md) and [style guide](CODINGSTYLE.md)
3837
[Install instructions](https://docs.ethswarm.org/docs/installation/quick-start)
3938

4039
## Get in touch
41-
[Only official website](https://www.ethswarm.org)
4240

41+
[Only official website](https://www.ethswarm.org)
4342

4443
## License
4544

0 commit comments

Comments
 (0)