Skip to content

Commit c2a6e00

Browse files
committed
Build Docker image choosing oura version.
1 parent 467bd0d commit c2a6e00

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

testdrive/ourabyversion/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM --platform=linux/amd64 rust:1-buster as builder
2+
3+
ARG RELEASE_TAG
4+
5+
RUN git config --global init.defaultBranch main && \
6+
git config --global advice.detachedHead false && \
7+
git init && \
8+
git remote add origin https://github.com/txpipe/oura.git && \
9+
git fetch && \
10+
test -z ${RELEASE_TAG} && GITREV=$(git describe --tags $(git rev-list --tags --max-count=1)) || GITREV=${RELEASE_TAG} && \
11+
git checkout "${GITREV}"
12+
13+
RUN cargo build --release --target x86_64-unknown-linux-gnu --all-features && \
14+
cp /target/x86_64-unknown-linux-gnu/release/oura /oura
15+
16+
# Run app
17+
FROM debian:buster-slim
18+
19+
COPY --from=builder /oura /usr/local/bin/oura
20+
21+
ENTRYPOINT [ "oura" ]

testdrive/ourabyversion/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Build Oura by version
2+
3+
## Introduction
4+
5+
This is a reference implementation to show how an image of _Oura_ can be built on demand; but also, sending the git revision as an argument through the command line
6+
7+
## Prerequisites
8+
9+
- Docker
10+
11+
## Variables and arguments
12+
13+
|Build Argument|Type|Default|Required|What it is|
14+
|---|---|---|---|---|
15+
|`RELEASE_TAG`|ARG|Last workin version|no|Tag number of the oura release. Follow this [link](https://github.com/txpipe/oura/tags) for reference.|
16+
17+
18+
### Build a Docker images with the latest Oura release
19+
```bash
20+
$ sudo docker build -t oura:latest .
21+
```
22+
```bash
23+
$ sudo docker run --rm oura:latest --version
24+
```
25+
```bash
26+
oura 1.3.2
27+
```
28+
29+
### Build a Docker image of Oura v1.0.0
30+
```bash
31+
$ sudo docker build -t oura:v1.0.0 . \
32+
--build-arg RELEASE_TAG=v1.0.0
33+
```
34+
```bash
35+
$ sudo docker run --rm oura:v1.0.0.0 --version
36+
```
37+
```bash
38+
oura 1.0.0
39+
```

0 commit comments

Comments
 (0)