create build script
This commit is contained in:
parent
a50c9bffdb
commit
6cfaf61246
2 changed files with 20 additions and 1 deletions
|
@ -1,4 +1,6 @@
|
|||
FROM rust:slim
|
||||
ARG UID="1000"
|
||||
ARG GID="1000"
|
||||
|
||||
WORKDIR /usr/src/refractr
|
||||
COPY . .
|
||||
|
@ -6,4 +8,8 @@ COPY . .
|
|||
RUN cargo build --release
|
||||
RUN cargo install --locked --path .
|
||||
|
||||
CMD ["refractr"]
|
||||
RUN groupadd -g $GID refractr
|
||||
RUN useradd -u $UID -g $GID -MN refractr
|
||||
USER refractr
|
||||
|
||||
CMD ["refractr"]
|
||||
|
|
13
build
Executable file
13
build
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
# Create all the different builds for refractr
|
||||
set -x
|
||||
version=$(cat Cargo.toml | grep -m1 version | awk -F' ' '{print $3}' | sed 's|"||g')
|
||||
|
||||
# docker builds
|
||||
cargo clean
|
||||
docker build -t refractr:$version .
|
||||
docker tag refractr:$version refractr:$latest
|
||||
|
||||
# rust build
|
||||
cargo build
|
||||
cargo build --release
|
Loading…
Add table
Reference in a new issue