-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce0471f
commit 827f169
Showing
7 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM almalinux/8-base as builder | ||
|
||
# setup source directory | ||
WORKDIR /usr/src/dsar | ||
COPY . . | ||
|
||
# prepare operating system and install rust | ||
RUN yum update -y | ||
RUN yum install -y openssl-devel gcc | ||
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y | ||
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/bin:/root/.cargo/bin | ||
|
||
# build executable | ||
RUN cargo build --release | ||
RUN strip -s target/release/dsar | ||
|
||
# generate rpm | ||
RUN cargo install cargo-generate-rpm | ||
RUN cargo generate-rpm -s 'release = "el.8"' | ||
RUN ls -ls /usr/src/dsar/target/generate-rpm/* | ||
|
||
FROM scratch as export-stage | ||
# output file | ||
COPY --from=builder /usr/src/dsar/target/generate-rpm/* / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM almalinux/9-base as builder | ||
|
||
# setup source directory | ||
WORKDIR /usr/src/dsar | ||
COPY . . | ||
|
||
# prepare operating system and install rust | ||
RUN yum update -y | ||
RUN yum install -y openssl-devel gcc | ||
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y | ||
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/bin:/root/.cargo/bin | ||
|
||
# build executable | ||
RUN cargo build --release | ||
RUN strip -s target/release/dsar | ||
|
||
# generate rpm | ||
RUN cargo install cargo-generate-rpm | ||
RUN cargo generate-rpm -s 'release = "el.9"' | ||
RUN ls -ls /usr/src/dsar/target/generate-rpm/* | ||
|
||
FROM scratch as export-stage | ||
# output file | ||
COPY --from=builder /usr/src/dsar/target/generate-rpm/* / | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM centos:centos7 as builder | ||
|
||
# setup source directory | ||
WORKDIR /usr/src/dsar | ||
COPY . . | ||
|
||
# prepare operating system and install rust | ||
RUN yum update -y | ||
RUN yum install -y openssl-devel gcc | ||
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y | ||
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/bin:/root/.cargo/bin | ||
|
||
# build executable | ||
RUN cargo build --release | ||
RUN strip -s target/release/dsar | ||
|
||
# generate rpm | ||
RUN cargo install cargo-generate-rpm | ||
RUN cargo generate-rpm --payload-compress=gzip -s 'release = "el.7"' | ||
RUN ls -ls /usr/src/dsar/target/generate-rpm/* | ||
|
||
FROM scratch as export-stage | ||
# output file | ||
COPY --from=builder /usr/src/dsar/target/generate-rpm/* / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM ubuntu:jammy as builder | ||
|
||
# setup source directory | ||
WORKDIR /usr/src/dsar | ||
COPY . . | ||
|
||
# prepare operating system and install rust | ||
RUN apt update && apt upgrade -y | ||
RUN apt-get install -y curl gcc libssl-dev pkg-config | ||
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y | ||
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/bin:/root/.cargo/bin | ||
|
||
# build executable | ||
RUN cargo build --release | ||
RUN strip -s target/release/dsar | ||
|
||
# generate rpm | ||
RUN cargo install cargo-deb | ||
RUN cargo deb | ||
|
||
# output file | ||
FROM scratch as export-stage | ||
COPY --from=builder /usr/src/dsar/target/debian/*deb / | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
docker build --rm --output . --file util/Dockerfile.build_centos_7 . | ||
docker build --rm --output . --file util/Dockerfile.build_alma_8 . | ||
docker build --rm --output . --file util/Dockerfile.build_alma_9 . | ||
docker build --rm --output . --file util/Dockerfile.build_ubuntu_2204 . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
cargo build --release | ||
strip -S target/release/dsar | ||
CARGO_APP_VERSION=$(grep ^version Cargo.toml | sed 's/.*"\(.*\)"/\1/') | ||
tar czvf dsar-osx-intel-v${CARGO_APP_VERSION}-1.tar.gz -C target/release dsar |