Skip to content

fix(docker): copy synocli source into build context - #145

Open
matonb wants to merge 1 commit into
SynologyOpenSource:mainfrom
matonb:fix/dockerfile-synocli-copy
Open

fix(docker): copy synocli source into build context#145
matonb wants to merge 1 commit into
SynologyOpenSource:mainfrom
matonb:fix/dockerfile-synocli-copy

Conversation

@matonb

@matonb matonb commented Jul 20, 2026

Copy link
Copy Markdown

Summary

docker build currently fails on an unmodified checkout of main. The
build stage's make target compiles both bin/synology-csi-driver and
bin/synocli (since build: bin/synology-csi-driver bin/synocli was
introduced in the CI-workflow commit), but the Dockerfile only ever
COPYs main.go and pkg/ into the builder image - synocli/ was
never added to the COPY list, so the in-container make fails:

Compiling bin/synocli…
stat /go/src/synok8scsiplugin/synocli: directory not found
make: *** [Makefile:42: bin/synocli] Error 1

This is why it hasn't been caught by CI: .github/workflows/ci.yaml
only runs make build directly on the runner (where synocli/ is
already present in the full checkout) and never invokes docker build,
so the two build paths diverged silently. Reproducible on a clean
checkout of main with just docker build -t test ..

Fix

Add the missing COPY synocli ./synocli alongside the existing
COPY main.go . / COPY pkg ./pkg lines.

Test plan

  • docker build -t synology-csi:test . fails on unmodified main with the error above
  • Same build succeeds with this one-line change, producing a working image (arm64), which I've since run in a live cluster

The build stage's `make` target compiles both bin/synology-csi-driver
and bin/synocli, but the Dockerfile only ever COPYed main.go and pkg/
into the builder image. Any image build fails outright with "stat
.../synocli: directory not found" since synocli was added (63e8c1b)
without updating the Dockerfile to match.
@matonb

matonb commented Aug 12, 2026

Copy link
Copy Markdown
Author

Hi — noticed daae1c1 on main lands this exact same one-line fix (COPY synocli ./synocli) that this PR already proposed on 2026-07-20. Happy to close this PR in favor of that commit — just flagging so it doesn't sit open unnecessarily. Also have #146 and #147 open if anyone gets a chance to look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant