Skip to content
Open
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
21 changes: 21 additions & 0 deletions testdrive/ourabyversion/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM --platform=linux/amd64 rust:1-buster as builder

ARG RELEASE_TAG

RUN git config --global init.defaultBranch main && \
git config --global advice.detachedHead false && \
git init && \
git remote add origin https://github.com/txpipe/oura.git && \
git fetch && \
test -z ${RELEASE_TAG} && GITREV=$(git describe --tags $(git rev-list --tags --max-count=1)) || GITREV=${RELEASE_TAG} && \
git checkout "${GITREV}"

RUN cargo build --release --target x86_64-unknown-linux-gnu --all-features && \
cp /target/x86_64-unknown-linux-gnu/release/oura /oura

# Run app
FROM debian:buster-slim

COPY --from=builder /oura /usr/local/bin/oura

ENTRYPOINT [ "oura" ]
39 changes: 39 additions & 0 deletions testdrive/ourabyversion/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Build Oura by version

## Introduction

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

## Prerequisites

- Docker

## Variables and arguments

|Build Argument|Type|Default|Required|What it is|
|---|---|---|---|---|
|`RELEASE_TAG`|ARG|Last workin version|no|Tag number of the oura release. Follow this [link](https://github.com/txpipe/oura/tags) for reference.|


### Build a Docker images with the latest Oura release
```bash
$ sudo docker build -t oura:latest .
```
```bash
$ sudo docker run --rm oura:latest --version
```
```bash
oura 1.3.2
```

### Build a Docker image of Oura v1.0.0
```bash
$ sudo docker build -t oura:v1.0.0 . \
--build-arg RELEASE_TAG=v1.0.0
```
```bash
$ sudo docker run --rm oura:v1.0.0.0 --version
```
```bash
oura 1.0.0
```