Skip to content

Commit

Permalink
Merge pull request #345 from tonyskapunk/containerfile
Browse files Browse the repository at this point in the history
Add containerfile for oha
  • Loading branch information
hatoo authored Dec 13, 2023
2 parents 68ecf89 + f9b76b0 commit 6bac9d0
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ARG RUST_VERSION=1.74
FROM docker.io/library/rust:${RUST_VERSION} AS build
WORKDIR /app
COPY . /app

RUN cargo install --path .

# Target image
FROM registry.fedoraproject.org/fedora-minimal
USER 65535

COPY --chown=65535:65535 --from=build /usr/local/cargo/bin/oha /bin/oha

ENTRYPOINT ["/bin/oha"]
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@ You can optionally build oha against [rustls](https://github.com/rustls/rustls)
apt update
apt install oha

## Containerized

You can also build and create a container image including oha

```sh
docker build . -t example.com/hatoo/oha:latest
```

Then you can use oha directly throught the container

```sh
docker run -it example.com/hatoo/oha:latest https://example.com:3000
```

# Platform

- Linux - Tested on Ubuntu 18.04 gnome-terminal
Expand Down

0 comments on commit 6bac9d0

Please sign in to comment.