forked from async-graphql/graphgate
-
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.
Push docker image to GitHub packages
- Loading branch information
1 parent
c44a034
commit a7ef213
Showing
7 changed files
with
62 additions
and
178 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 |
---|---|---|
|
@@ -9,24 +9,29 @@ jobs: | |
cover: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Install libsqlite3-dev | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libsqlite3-dev | ||
- name: Run cargo-tarpaulin | ||
uses: actions-rs/[email protected] | ||
with: | ||
version: '0.14.3' | ||
version: "0.14.3" | ||
args: --out Xml --all | ||
- name: Upload to codecov.io | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{secrets.CODECOV_TOKEN}} | ||
|
||
# - name: Upload to codecov.io | ||
# uses: codecov/[email protected] | ||
# with: | ||
# token: ${{secrets.CODECOV_TOKEN}} | ||
|
||
- name: Archive code coverage results | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,44 +1,23 @@ | ||
### | ||
# Builder | ||
### | ||
FROM rust:latest as builder | ||
FROM rust:alpine as builder | ||
|
||
RUN rustup target add x86_64-unknown-linux-musl | ||
RUN apt update && apt install -y musl-tools musl-dev | ||
RUN update-ca-certificates | ||
ARG TARGETPLATFORM | ||
|
||
ENV USER=graphgate | ||
ENV UID=10001 | ||
|
||
|
||
RUN adduser \ | ||
--disabled-password \ | ||
--gecos "" \ | ||
--home "/nonexistent" \ | ||
--shell "/sbin/nologin" \ | ||
--no-create-home \ | ||
--uid "${UID}" \ | ||
"${USER}" | ||
RUN apk add --no-cache ca-certificates musl-dev openssl-dev openssl-libs-static \ | ||
&& update-ca-certificates | ||
|
||
WORKDIR /graphgate | ||
|
||
COPY ./ . | ||
|
||
RUN cargo build --target x86_64-unknown-linux-musl --release | ||
|
||
### | ||
# Final Image | ||
### | ||
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then ARCHITECTURE=x86_64; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCHITECTURE=aarch64; fi \ | ||
&& rustup target add ${ARCHITECTURE}-unknown-linux-musl \ | ||
&& cargo build --target ${ARCHITECTURE}-unknown-linux-musl --release \ | ||
&& mv target/${ARCHITECTURE}-unknown-linux-musl/release/graphgate target/graphgate | ||
|
||
FROM scratch | ||
|
||
COPY --from=builder /etc/passwd /etc/passwd | ||
COPY --from=builder /etc/group /etc/group | ||
|
||
WORKDIR /graphgate | ||
|
||
COPY --from=builder /graphgate/target/x86_64-unknown-linux-musl/release/graphgate ./ | ||
|
||
USER graphgate:graphgate | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
COPY --from=builder /graphgate/target/graphgate ./ | ||
|
||
USER 1000 | ||
ENTRYPOINT [ "/graphgate/graphgate" ] |
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