dioxus
dioxus copied to clipboard
Can't build docker image from fullstack dioxus project
Hello! I'm trying to build dioxus fullstack project, bug get that error:
9.422 warning: `custody_app` (bin "custody_app" test) generated 2 warnings (run `cargo fix --bin "custody_app" --tests` to apply 2 suggestions)
9.422 warning: `custody_app` (bin "custody_app") generated 2 warnings (2 duplicates)
9.422 Finished `dev` profile [unoptimized + debuginfo] target(s) in 9.25s
9.839 0. 0s INFO Bundling project...
10.12 0.281s INFO Building app...
10.12 0.282s ERROR err=Other(Failed to initialize profiles - dioxus can't build without them. You might need to initialize them yourself.
10.12
10.12 Caused by:
10.12 0: Failed to write profiles to Cargo.toml
10.12 1: Read-only file system (os error 30))
10.12 0.283s ERROR err=Other(Failed to initialize profiles - dioxus can't build without them. You might need to initialize them yourself.
10.12
10.12 Caused by:
10.12 0: Failed to write profiles to Cargo.toml
10.12 1: Read-only file system (os error 30))
Docker stage for building:
################################################################################
# Create a stage for building all targets.
ARG RUST_VERSION=1.85
# Use non-slim image, for working openssl libs
FROM rust:${RUST_VERSION}-bookworm AS build
WORKDIR /app
RUN apt update && apt install -y curl libssl-dev pkg-config protobuf-compiler
RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
RUN cargo binstall dioxus-cli
RUN --mount=type=bind,source=Cargo.toml,target=Cargo.toml \
--mount=type=bind,source=Cargo.lock,target=Cargo.lock \
--mount=type=bind,source=services,target=services \
--mount=type=bind,source=crates,target=crates \
--mount=type=bind,source=apps,target=apps \
--mount=type=bind,source=proto,target=proto \
--mount=type=cache,target=/app/target/ \
--mount=type=cache,target=/usr/local/cargo/registry/ \
set -e && \
cargo build --locked --all-targets && \
cp ./target/debug/security_module /app/security_module && \
cp ./target/debug/blockchain_adapter /app/blockchain_adapter && \
cp ./target/debug/transaction_engine /app/transaction_engine && \
dx bundle --package custody_app --platform web && \
cp ./target/dx/custody_app/release/web/server /app/fullstack/server && \
cp ./target/dx/custody_app/release/web/server /app/fullstack/server && \
cp ./target/dx/custody_app/release/web/public /app/fullstack/public