Home > Blockchain >  Docker image silently fails to start
Docker image silently fails to start

Time:06-10

The following docker image successfully builds but will just not run - without any (visible) error:

FROM alpine:3

RUN apk --no-cache add transmission-cli transmission-daemon \
    && mkdir -p /transmission/config \
    && chmod -R 777 /transmission 

RUN apk add --no-cache --upgrade bash
RUN wget -P ./transmission/ https://speed.hetzner.de/100MB.bin

ENV TRACKER_URL="http://104.219.73.18:6969/announce"
RUN echo tracker url is: ${TRACKER_URL}
RUN transmission-create -t ${TRACKER_URL} -o ./transmission/testfile.torrent /transmission/100MB.bin

CMD transmission-daemon -c ./transmission --config-dir ./transmission/

The logs show nothing for me. What's strange: If I build the image, run a shell inside it and execute the CMD, everything runs just fine. I've already tried wrapping the CMD in a bash script and executed that (because why not), but with the same result.

What am I missing?

CodePudding user response:

If you run tranmission-daemon yourself on the command line, you'll see that it puts itself into the background. From Docker's perspective, your container just exited!

You need to add the -f (--foreground) option to your tranmission-daemon command line:

CMD transmission-daemon -f -c ./transmission --config-dir ./transmission/
  • Related