docker pull kovacshuni/riptube:1.0.0-SNAPSHOT
docker run -it -P --name="riptube" kovacshuni/riptube:1.0.0-SNAPSHOT
bin/riptube &
curl -X POST -d "Hi there" localhost:8082/notify
INFO 15:55:06 c.h.r.NotificationReceiver$ - Hi there
所以这行得通。但是从外部,从 docker 守护进程的主机来看,它没有。尽管有 EXPOSE 命令和 -P 参数。
docker port riptube 8082
0.0.0.0:32785
curl -X POST -d "Hi there" localhost:32785/notify
curl: (52) Empty reply from server
为什么?:( :(
源代码在这里。Dockerfile 也是如此,但粘贴在下面:
FROM frolvlad/alpine-oraclejdk8
RUN apk add --update bash py-pip ca-certificates curl
RUN rm -rf /var/cache/apk/*
RUN pip install youtube-dl
WORKDIR /opt/riptube
ADD target/pack/ /opt/riptube
EXPOSE 8082
ENTRYPOINT /bin/bash
CMD