Dockerfile and docker-compose.yml are broken: copies a missing config.toml, wrong binary/subcommand, stale OpenSSL dep, wrong source path and port #40

Open
opened 2026-05-12 08:06:51 +00:00 by rawan · 0 comments
Member

Summary

Neither the Dockerfile nor docker-compose.yml works against the current workspace. docker compose build fails at the first COPY and, even if it didn't, the resulting image would crash on start.

Problems

Dockerfile:

FROM rust:slim as builder
WORKDIR /src
COPY myfs /src                 # (1) there is no `myfs/` directory at repo root
COPY Cargo.toml .
COPY Cargo.lock .
COPY config.toml .             # (2) `config.toml` is in .gitignore and not in the repo
RUN apt-get update && apt-get install curl build-essential libssl-dev musl-tools -y   # (3) reinstalls libssl-dev — see ADR-008 "remove OpenSSL dependency"
RUN rustup target add x86_64-unknown-linux-musl
RUN cargo build --release --target=x86_64-unknown-linux-musl

FROM alpine:3.19
WORKDIR /app
COPY --from=builder /src/target/x86_64-unknown-linux-musl/release/myfs .
COPY --from=builder /src/config.toml .
ENTRYPOINT [ "./myfs", "server", "--config-path", "config.toml" ]   # (4) the `myfs` binary has no `server` subcommand

Specifically:

  1. COPY myfs /src — the repo is a workspace (myfs-core, myfs-lib, myfs-hub, myfs-tool, myfs-test-utils); there is no myfs/ directory, so the build aborts here.
  2. COPY config.toml .config.toml is listed in .gitignore and is not committed, so this COPY fails even after fixing (1).
  3. apt-get install ... libssl-dev ...docs/adr/008-remove-openssl-dependency.md says OpenSSL was intentionally removed (rustls everywhere). The Dockerfile drags it back in.
  4. ENTRYPOINT ["./myfs", "server", ...] — the server lives in the myfs-hub binary and the subcommand is serve (myfs-hub serve --config-path ...). The myfs binary only has mount/pack/unpack/upload/download/..., so the container would exit immediately with a clap error.

docker-compose.yml:

services:
  fl-server:
    build: .
    ports:
      - 3000:3000
  • Port 3000 doesn't match anything documented; README.md uses 8080 (store_url/host/port come from the TOML config, default 8080). The port mapping should match whatever the committed example config uses.

Suggested fix

  • Build the whole workspace (COPY . . from repo root, or copy the crate dirs explicitly) and cargo build --release --workspace (or -p myfs-hub).
  • Commit an example config.toml (e.g. config.example.toml, un-gitignored) and COPY that, or generate it at runtime.
  • Drop libssl-dev from the apt install line (rustls only).
  • Fix the entrypoint to myfs-hub serve --config-path /app/config.toml and COPY the myfs-hub binary, not myfs.
  • Align the compose port mapping with the config's host/port.

If containerization isn't a supported deployment path right now, consider just deleting Dockerfile + docker-compose.yml until it is.

## Summary Neither the `Dockerfile` nor `docker-compose.yml` works against the current workspace. `docker compose build` fails at the first `COPY` and, even if it didn't, the resulting image would crash on start. ## Problems `Dockerfile`: ```dockerfile FROM rust:slim as builder WORKDIR /src COPY myfs /src # (1) there is no `myfs/` directory at repo root COPY Cargo.toml . COPY Cargo.lock . COPY config.toml . # (2) `config.toml` is in .gitignore and not in the repo RUN apt-get update && apt-get install curl build-essential libssl-dev musl-tools -y # (3) reinstalls libssl-dev — see ADR-008 "remove OpenSSL dependency" RUN rustup target add x86_64-unknown-linux-musl RUN cargo build --release --target=x86_64-unknown-linux-musl FROM alpine:3.19 WORKDIR /app COPY --from=builder /src/target/x86_64-unknown-linux-musl/release/myfs . COPY --from=builder /src/config.toml . ENTRYPOINT [ "./myfs", "server", "--config-path", "config.toml" ] # (4) the `myfs` binary has no `server` subcommand ``` Specifically: 1. `COPY myfs /src` — the repo is a workspace (`myfs-core`, `myfs-lib`, `myfs-hub`, `myfs-tool`, `myfs-test-utils`); there is no `myfs/` directory, so the build aborts here. 2. `COPY config.toml .` — `config.toml` is listed in `.gitignore` and is not committed, so this `COPY` fails even after fixing (1). 3. `apt-get install ... libssl-dev ...` — `docs/adr/008-remove-openssl-dependency.md` says OpenSSL was intentionally removed (rustls everywhere). The Dockerfile drags it back in. 4. `ENTRYPOINT ["./myfs", "server", ...]` — the server lives in the `myfs-hub` binary and the subcommand is `serve` (`myfs-hub serve --config-path ...`). The `myfs` binary only has `mount/pack/unpack/upload/download/...`, so the container would exit immediately with a clap error. `docker-compose.yml`: ```yaml services: fl-server: build: . ports: - 3000:3000 ``` - Port `3000` doesn't match anything documented; `README.md` uses `8080` (`store_url`/`host`/`port` come from the TOML config, default 8080). The port mapping should match whatever the committed example config uses. ## Suggested fix - Build the whole workspace (`COPY . .` from repo root, or copy the crate dirs explicitly) and `cargo build --release --workspace` (or `-p myfs-hub`). - Commit an example `config.toml` (e.g. `config.example.toml`, un-gitignored) and `COPY` that, or generate it at runtime. - Drop `libssl-dev` from the apt install line (rustls only). - Fix the entrypoint to `myfs-hub serve --config-path /app/config.toml` and `COPY` the `myfs-hub` binary, not `myfs`. - Align the compose port mapping with the config's `host`/`port`. If containerization isn't a supported deployment path right now, consider just deleting `Dockerfile` + `docker-compose.yml` until it is.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
geomind_code/my_fs#40
No description provided.