Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: change binary path in docker image #1149

Merged
merged 1 commit into from
Mar 16, 2023
Merged

Conversation

just1900
Copy link
Contributor

For latest ss docker image, the entrypoint is /usr/local/bin/docker-entrypoint.sh.
the volumeMount config here will overwrite binaries under /usr/local/bin,

        - name: plugins
          mountPath: /usr/local/bin

which will result in the following error.

exec: "docker-entrypoint.sh": executable file not found in $PATH: unknown

@zonyitoo
Copy link
Collaborator

Well, it will also overwrite the sslocal and ssserver binaries in /usr/local/bin. Maybe we should put sslocal or ssserver into /usr/bin.

@zonyitoo
Copy link
Collaborator

I would personally prefer this solution:

diff --git a/Dockerfile b/Dockerfile
index 6c7f4328..573d8927 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -38,18 +38,18 @@ RUN case "$TARGETARCH" in \

 FROM alpine:3.17 AS sslocal

-COPY --from=builder /root/shadowsocks-rust/target/release/sslocal /usr/local/bin/
+COPY --from=builder /root/shadowsocks-rust/target/release/sslocal /usr/bin/
 COPY --from=builder /root/shadowsocks-rust/examples/config.json /etc/shadowsocks-rust/
-COPY --from=builder /root/shadowsocks-rust/docker/docker-entrypoint.sh /usr/local/bin/
+COPY --from=builder /root/shadowsocks-rust/docker/docker-entrypoint.sh /usr/bin/

 ENTRYPOINT [ "docker-entrypoint.sh" ]
 CMD [ "sslocal", "--log-without-time", "-c", "/etc/shadowsocks-rust/config.json" ]

 FROM alpine:3.17 AS ssserver

-COPY --from=builder /root/shadowsocks-rust/target/release/ssserver /usr/local/bin/
+COPY --from=builder /root/shadowsocks-rust/target/release/ssserver /usr/bin/
 COPY --from=builder /root/shadowsocks-rust/examples/config.json /etc/shadowsocks-rust/
-COPY --from=builder /root/shadowsocks-rust/docker/docker-entrypoint.sh /usr/local/bin/
+COPY --from=builder /root/shadowsocks-rust/docker/docker-entrypoint.sh /usr/bin/

 ENTRYPOINT [ "docker-entrypoint.sh" ]

What do you think?

@just1900
Copy link
Contributor Author

This LGTM :)

…erwrite in k8s deployment

Signed-off-by: just1900 <legendj228@gmail.com>
@just1900
Copy link
Contributor Author

@zonyitoo PTAL

@zonyitoo zonyitoo merged commit dcdb80b into shadowsocks:master Mar 16, 2023
@just1900 just1900 changed the title fix: error starting container if not download plugins Fix: change binary path in docker image Mar 16, 2023
@KainanSu
Copy link

I used the latest with the same problem.
So I use v1.14.2 instead.

@kongzi68
Copy link

用最新的镜像 v1.15.4 也会出现相同的问题
Error: failed to create containerd task: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "docker-entrypoint.sh": executable file not found in $PATH: unknown

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.

4 participants