build(docker): add Dockerfile for building a server image - #641
Conversation
Multi-stage build: compiles aw-webui and aw-server, then ships only the release binary on debian:bookworm-slim with libssl3. Only aw-server is built, not aw-sync: on Linux the latter pulls in openssl with the "vendored" feature and compiles OpenSSL from source, which is not needed by the image.
| RUN apt-get update -qq -y && \ | ||
| apt-get install -qq -y --no-install-recommends \ | ||
| build-essential pkg-config libssl-dev ca-certificates curl git make gnupg && \ | ||
| curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \ |
There was a problem hiding this comment.
Unverified installer controls build artifacts
When the floating NodeSource endpoint is compromised, intercepted, or changed unexpectedly, its response executes directly as root in the builder stage and can modify the server or web assets copied into the runtime image, causing the published image to contain unreviewed code. How this was verified: The remote response runs before make aw-server in the same builder stage whose outputs are copied into the final image.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
|
||
| EXPOSE 5600 | ||
|
|
||
| CMD ["aw-server-rust"] |
There was a problem hiding this comment.
The runtime stage has no USER directive, so the documented network-facing server and its datastore operations run as UID 0; this unnecessarily expands the impact of a process compromise and creates root-owned files on bind-mounted storage. How this was verified: The final stage launches aw-server-rust without changing users, and the application does not drop privileges.
Greptile SummaryAdds a containerized build and runtime path for aw-server-rust.
Confidence Score: 3/5The PR should not merge until the builder stops executing unverified remote installer content that can modify the shipped image. The NodeSource response runs as root in the same stage that produces artifacts copied into the final image, while the runtime also unnecessarily retains root privileges. Files Needing Attention: Dockerfile
|
| Filename | Overview |
|---|---|
| Dockerfile | Adds the complete image build and runtime flow, but executes an unverified remote installer and runs the final service as root. |
| .dockerignore | Excludes generated build, dependency, coverage, and local-tool artifacts from the Docker context. |
| README.md | Documents the Docker workflow and correct persistent datastore path, while reinforcing the image's root-user runtime assumptions. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
S[Repository checkout] --> B[Rust builder image]
N[NodeSource setup script] --> B
B --> W[Build aw-webui]
W --> R[Build release aw-server]
R --> I[Debian runtime image]
I --> C[Run aw-server on port 5600]
V[(Persistent datastore volume)] --> C
Reviews (1): Last reviewed commit: "build(docker): add Dockerfile for buildi..." | Re-trigger Greptile
|
We have rejected similar PRs in the past, as the Dockerfiles aren't being used by maintainers or in CI and so not something we want to maintain or bless/suggest we support. If you explain your usecase I might change my mind. |
Fair enough — I understand not wanting to bless or maintain something you Use case: I run aw-server-rust as an always-on central instance on a Why this might matter to the project: the absence of a Dockerfile What I'm not asking for: no official image on Docker Hub, no release To address the maintenance concern, I'm happy to do any of:
One thing the containerized build surfaced, incidentally: If the answer is still no, that's completely fine — I'll keep it in my That's a very nice project! Congrats! |
Multi-stage build: compiles aw-webui and aw-server, then ships only the release binary on debian:bookworm-slim with libssl3.
Only aw-server is built, not aw-sync: on Linux the latter pulls in openssl with the "vendored" feature and compiles OpenSSL from source, which is not needed by the image.