Attempt to remove dependency on rust-musl-builder

This commit is contained in:
Eric Zhang 2021-11-11 00:51:57 -05:00
parent 855ca5b839
commit 73a8461da6
5 changed files with 13 additions and 8 deletions

View file

@ -13,6 +13,9 @@ jobs:
name: Docker Build and Push
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

View file

@ -1,8 +1,9 @@
FROM ekidd/rust-musl-builder:latest as backend
FROM rust:alpine as backend
WORKDIR /home/rust/src
RUN apk --no-cache add musl-dev openssl-dev
COPY . .
RUN cargo test --release
RUN cargo build --release
RUN cargo test --release rustpad-server
RUN cargo build --release rustpad-server
FROM rust:alpine as wasm
WORKDIR /home/rust/src
@ -23,6 +24,6 @@ RUN npm run build
FROM scratch
COPY --from=frontend /usr/src/app/build build
COPY --from=backend /home/rust/src/target/x86_64-unknown-linux-musl/release/rustpad-server .
COPY --from=backend /home/rust/src/target/release/rustpad-server .
USER 1000:1000
CMD [ "./rustpad-server" ]

View file

@ -103,8 +103,9 @@ docker pull ekzhang/rustpad
```
(You can also manually build this image with `docker build -t rustpad .` in the
project root directory.) To run locally, execute the following command, then
open `http://localhost:3030` in your browser.
project root directory, ensuring that your target platform is `linux/amd64`.) To
run locally, execute the following command, then open `http://localhost:3030` in
your browser.
```
docker run --rm -dp 3030:3030 ekzhang/rustpad

View file

@ -2,7 +2,7 @@
name = "rustpad-server"
version = "0.1.0"
authors = ["Eric Zhang <ekzhang1@gmail.com>"]
edition = "2018"
edition = "2021"
[dependencies]
anyhow = "1.0.40"

View file

@ -2,7 +2,7 @@
name = "rustpad-wasm"
version = "0.1.0"
authors = ["Eric Zhang <ekzhang1@gmail.com>"]
edition = "2018"
edition = "2021"
[lib]
crate-type = ["cdylib", "rlib"]