Building an image, bin/sh not found

Hi, I am very new to docker. I’m following a tutorial to create my own container with qbittorrent that runs through NordVPN: https://www.youtube.com/watch?v=-Ae6Mk6u3WA.

My docker file is exactly as depicted in the video (with my own VPN username and password). The guide does not include how to build the rest of the image other than the dockerfile, so I’m really lost here.

First there was the issue of entrypoint.sh not found when building, so I created an empty entrypoint.sh in the directory. Now the image builds but when the container is run, I get the following error:

/bin/sh: [/bin/sh,: not found

Sorry if this is a very basic question but I can’t find a good guide anywhere that would get this working.

Please, share your Dockerfile. Users will probably not like to search for relevant parts in the video. Share it es a code block here. Help for code blocks

But based on the error message, you probably defined the command as an invalid json list without quotation marks.

Correct

CMD ["/bin/sh", "other arg"]

Incorrect:

CMD [/bin/sh, other arg]

This is a string and it will look for the executable called “[/bin/sh,” instead of “/bin/sh

But since you created an empty entrypoint, the command will do nothing. As the CMD is the argument of the entrypoint and the entrypoint script has to execute it.

Recommended links to learn the basics and concepts:

Hi, thanks for the help. Here is the dockerfile:

FROM qmcgaw/gluetun:latest

RUN apk update && \

apk add qbittorrent-nox

ENV VPN_SERVICE_PROVIDER=nordvpn

ENV OPENVPN_USER=myuser

ENV OPENVPN_PASSWORD=mypassword

ENV SERVER_REGIONS=Canada

ENV VPN_TYPE=openvpn

COPY entrypoint.sh /entrypoint.sh

RUN chmod +x /entrypoint.sh

RUN chmod +x /gluetun-entrypoint

EXPOSE 30078 8989 8118 9091 6881 6881/udp

ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]

I actually have an update, the container now runs without the previous error but just lists the container’s IP in the log and then the container stops itself. Entrypoint.sh is still blank so I assume that is part of, if not the whole problem.

I’ll also look through those tutorials you posted. Thanks again!

Yes. No doubt, that is a problem.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.