mirror of
https://github.com/roapi/roapi.git
synced 2026-06-05 21:04:02 +08:00
update docker build to use entrypoint and github container registry (#14)
This commit is contained in:
parent
3631c2db14
commit
8af80415ef
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@ -0,0 +1,2 @@
|
||||
target
|
||||
docs
|
||||
@ -1,9 +1,13 @@
|
||||
FROM rust:1.50 as builder
|
||||
RUN cargo install --git https://github.com/roapi/roapi --branch main --bin roapi-http
|
||||
ARG RELEASE=main
|
||||
RUN cargo install --git https://github.com/roapi/roapi --branch $RELEASE --bin roapi-http
|
||||
|
||||
FROM debian:buster-slim
|
||||
LABEL org.opencontainers.image.source https://github.com/roapi/roapi
|
||||
|
||||
RUN apt-get update && apt-get install -y libssl-dev && rm -rf /var/lib/apt/lists/*
|
||||
COPY test_data /test_data
|
||||
COPY --from=builder /usr/local/cargo/bin/roapi-http /usr/local/bin/roapi-http
|
||||
|
||||
CMD ["roapi-http"]
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["roapi-http"]
|
||||
|
||||
19
README.md
19
README.md
@ -31,10 +31,7 @@ See below for a high level diagram:
|
||||
cargo install --git https://github.com/roapi/roapi --branch main --bin roapi-http
|
||||
```
|
||||
|
||||
```bash
|
||||
# docker build
|
||||
docker build . -t roapi-http
|
||||
```
|
||||
A prebuilt docker image is also available at [ghcr.io/roapi/roapi-http](https://github.com/orgs/roapi/packages/container/package/roapi-http).
|
||||
|
||||
|
||||
## Usage
|
||||
@ -50,9 +47,10 @@ roapi-http \
|
||||
--table 'spacex_launches:test_data/spacex-launches.json'
|
||||
```
|
||||
|
||||
Or using docker:
|
||||
|
||||
```bash
|
||||
# docker run
|
||||
docker run --rm -t -p 8080:8080 roapi-http roapi-http --addr 0.0.0.0:8080 \
|
||||
docker run -t --rm -p 8080:8080 ghcr.io/roapi/roapi-http:latest --addr 0.0.0.0:8080 \
|
||||
--table 'uk_cities:test_data/uk_cities_with_headers.csv' \
|
||||
--table 'spacex_launches:test_data/spacex-launches.json'
|
||||
```
|
||||
@ -282,3 +280,12 @@ wraps `columnq` with a HTTP based API layer. It serializes Arrow record batches
|
||||
produced by `columnq` into different formats based on client request.
|
||||
|
||||
Building ROAPI with `simd` optimization requires nightly rust toolchain.
|
||||
|
||||
|
||||
### Build Docker image
|
||||
|
||||
```bash
|
||||
docker build --build-arg RELEASE=main --rm -t ghcr.io/roapi/roapi-http:latest .
|
||||
```
|
||||
|
||||
You can set `RELEASE` variable to any git reference to build for a specific version.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user