Skip to content

Commit 849ee89

Browse files
authored
Update Dockerfile (#10)
* Update Dockerfile * Update CHANGES.md
1 parent b5dbd8d commit 849ee89

File tree

5 files changed

+50
-5
lines changed

5 files changed

+50
-5
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
44

55

66
## Unreleased
7+
8+
9+
## 0.1.1 (2019-11-06)
10+
- Update Dockerfile #10 @mosuka
711
- Fixed typo in error message #6 @eko
812
- Dockerfile for tests and profit #5 @iyesin
913
- Small typo in get command example fixed #4 @msmakhlouf

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bayard"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
authors = ["Minoru Osuka <[email protected]>"]
55
edition = "2018"
66

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM rust:slim-stretch as builder
1+
FROM rust:1.38.0-slim-stretch as builder
22

33
WORKDIR /repo
44
ADD . /repo/
@@ -13,4 +13,5 @@ WORKDIR /
1313
COPY --from=builder /repo/bin /usr/local/bin
1414
COPY --from=builder /repo/etc/* /etc/
1515
EXPOSE 5000
16-
ENTRYPOINT [ "bayard", "serve" ]
16+
ENTRYPOINT [ "bayard" ]
17+
CMD [ "serve" ]

Makefile

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
BIN_DIR = $(CURDIR)/bin
2-
DATA_DIR = $(CURDIR)/data
1+
BIN_DIR ?= $(CURDIR)/bin
2+
DATA_DIR ?= $(CURDIR)/data
33
CARGO_TARGET_DIR ?= $(CURDIR)/target
4+
VERSION ?=
5+
6+
ifeq ($(VERSION),)
7+
VERSION = $(shell cargo metadata --no-deps --format-version=1 | jq -r '.packages[] | select(.name=="bayard") | .version')
8+
endif
49

510
clean:
611
rm -rf $(BIN_DIR)
@@ -18,3 +23,14 @@ build:
1823
cargo build --release
1924
mkdir -p $(BIN_DIR)
2025
cp $(CARGO_TARGET_DIR)/release/bayard $(BIN_DIR)/
26+
27+
docker-build:
28+
docker build -t bayardsearch/bayard:latest .
29+
docker tag bayardsearch/bayard:latest bayardsearch/bayard:$(VERSION)
30+
31+
docker-push:
32+
docker push bayardsearch/bayard:latest
33+
docker push bayardsearch/bayard:$(VERSION)
34+
35+
docker-clean:
36+
docker rmi -f $(shell docker images --filter "dangling=true" -q --no-trunc)

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,3 +214,27 @@ $ ./bin/bayard leave \
214214
--peers="1=0.0.0.0:5001,2=0.0.0.0:5002" \
215215
--leader-id=1
216216
```
217+
218+
219+
## Bayard on Docker
220+
221+
### Pulling Docker container image from docker.io
222+
223+
You can pull the Docker container image already registered in docker.io like so:
224+
225+
```
226+
$ docker pull bayardsearch/bayard:latest
227+
```
228+
229+
Check the available version at the following URL:
230+
https://hub.docker.com/r/bayardsearch/bayard/tags/
231+
232+
### Running Docker container
233+
234+
Running a Bayard on Docker like so:
235+
236+
```
237+
$ docker run --rm --name bayard \
238+
-p 5000:5000 \
239+
bayardsearch/bayard:latest
240+
```

0 commit comments

Comments
 (0)