Fix Docker Compose build: SSL certificate trust, WASM dependencies, and Cargo.toml configuration#2
Draft
Fix Docker Compose build: SSL certificate trust, WASM dependencies, and Cargo.toml configuration#2
Conversation
…argo.toml fix Co-authored-by: yndolg <33730531+yndolg@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix Docker compose build to work again
Fix Docker Compose build: SSL certificate trust, WASM dependencies, and Cargo.toml configuration
Oct 21, 2025
yndolg
requested changes
Oct 21, 2025
Collaborator
yndolg
left a comment
There was a problem hiding this comment.
Doesn’t run yet. Please make sure docker compose up also works and serves a page.
Error on my server:
warning: onig_sys@69.8.1: In file included from oniguruma/src/regexec.c:36:
43.32 warning: onig_sys@69.8.1: oniguruma/src/regint.h:110:10: fatal error: 'stdlib.h' file not found
43.32 warning: onig_sys@69.8.1: #include <stdlib.h>
43.32 warning: onig_sys@69.8.1: ^~~~~~~~~~
43.32 warning: onig_sys@69.8.1: 1 error generated.
43.32 error: failed to run custom build command for onig_sys v69.8.1
43.32
43.32 Caused by:
43.32 process didn't exit successfully: /app/target/front/wasm-release/build/onig_sys-72bff88999ee4d35/build-script-build (exit status: 1)
43.32 --- stdout
43.32 cargo:rerun-if-env-changed=RUSTONIG_DYNAMIC_LIBONIG
43.32 cargo:rerun-if-env-changed=RUSTONIG_STATIC_LIBONIG
43.32 cargo:rerun-if-env-changed=RUSTONIG_SYSTEM_LIBONIG
43.32 TARGET = Some("wasm32-unknown-unknown")
43.32 OPT_LEVEL = Some("z")
43.32 HOST = Some("x86_64-unknown-linux-gnu")
43.32 cargo:rerun-if-env-changed=CC_wasm32-unknown-unknown
43.32 CC_wasm32-unknown-unknown = None
43.32 cargo:rerun-if-env-changed=CC_wasm32_unknown_unknown
43.32 CC_wasm32_unknown_unknown = None
43.32 cargo:rerun-if-env-changed=TARGET_CC
43.32 TARGET_CC = None
43.32 cargo:rerun-if-env-changed=CC
43.32 CC = None
43.32 cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
43.32 cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
43.32 CRATE_CC_NO_DEFAULTS = None
43.32 DEBUG = Some("true")
43.32 cargo:rerun-if-env-changed=CFLAGS_wasm32-unknown-unknown
43.32 CFLAGS_wasm32-unknown-unknown = None
43.32 cargo:rerun-if-env-changed=CFLAGS_wasm32_unknown_unknown
43.32 CFLAGS_wasm32_unknown_unknown = Some("--sysroot=/usr/share/wasi-sysroot")
43.32 cargo:warning=In file included from oniguruma/src/regexec.c:36:
43.32 cargo:warning=oniguruma/src/regint.h:110:10: fatal error: 'stdlib.h'
file not found
43.32 cargo:warning=#include <stdlib.h>
43.32 cargo:warning= ^~~~~~~~~~
43.32 cargo:warning=1 error generated.
43.32
43.32 --- stderr
43.32
43.32
43.32 error occurred: Command "clang" "-Oz" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "--target=wasm32-unknown-unknown" "-I" "/app/target/front/wasm32-unknown-unknown/wasm-release/build/onig_sys-3f746be26acd8da4/out" "-I" "oniguruma/src" "--sysroot=/usr/share/wasi-sysroot" "-DONIG_DISABLE_DIRECT_THREADING=1" "-DONIG_EXTERN=attribute((visibility("default")))" "-o" "/app/target/front/wasm32-unknown-unknown/wasm-release/build/onig_sys-3f746be26acd8da4/out/c77b18e714869709-regexec.o" "-c" "oniguruma/src/regexec.c" with args clang did not execute successfully (status code exit status: 1).
43.32
43.32
43.32 warning: build failed, waiting for other jobs to finish...
48.96 Cargo process finished with code Some(101)
48.96 Error: Failed to build chatclm
failed to solve: process "/bin/sh -c cargo leptos build --release -vv" did not complete successfully: exit code: 1
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Fixed multiple issues preventing the Docker Compose build from completing successfully. The build was failing due to SSL certificate verification errors, missing WASM compilation dependencies, and Cargo.toml configuration issues.
Root Causes Identified
1. SSL Certificate Verification Failure
The build environment uses a GoProxy MITM proxy with a self-signed mkcert certificate for intercepting HTTPS traffic. When downloading dependencies from GitHub and crates.io, both
wgetandcurlwere failing with SSL verification errors:2. WASM Compilation Errors
The
onig_syscrate (used as a transitive dependency) failed to compile for thewasm32-unknown-unknowntarget because clang couldn't find standard C library headers:3. Cargo.toml Configuration
The project defines multiple binary targets (
chatclmandtuning), but cargo-leptos wasn't told which one to use:Changes Made
Dockerfile
build-essential,clang, andwasi-libcpackagesCFLAGS_wasm32_unknown_unknownenvironment variable to point clang to the correct system headers for WASM compilationCargo.toml
bin-target = "chatclm"to the[package.metadata.leptos]section to explicitly tell cargo-leptos which binary to build.gitignore
Testing Notes
The mkcert certificate file is environment-specific and is not committed to the repository. Developers building in different environments may need to:
Related
Fixes the issue described in #[issue_number] - "Docker compose build should work again"
Original prompt
Fixes #1
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.