如何解决在Alpine Docker中重启Tor
下面创建了这个docker镜像。我想在不重新启动容器的情况下重新启动Tor。我该怎么办?
Docker映像:
# set alpine as the base image of the Dockerfile
FROM alpine:edge
# update the package repository and install Tor
RUN apk update
RUN apk upgrade --no-cache
RUN apk add --no-cache tor
RUN apk add --no-cache bash
RUN apk add --no-cache build-base
RUN apk add --no-cache python3
RUN apk add --no-cache python3-dev
RUN apk add py3-pip
RUN pip3 install --no-cache-dir --upgrade pip
RUN apk add --no-cache openrc
# python library
RUN pip3 install Flask
# Copy over the torrc created above and set the owner to `tor`
RUN echo "Log notice stdout" >> /etc/tor/torrc
RUN echo "SocksPort 0.0.0.0:9050" >> /etc/tor/torrc
RUN chown -R tor /etc/tor
COPY ./app.py /app.py
# RUN echo "tor -f /etc/tor/torrc &" >> /start.sh
RUN echo "rc-service tor start" >> /start.sh
RUN echo "python3 app.py" >> /start.sh
RUN chmod +x /start.sh
EXPOSE 8000
EXPOSE 9050
# Set the default container command
# This can be overridden later when running a container
ENTRYPOINT [ "/bin/bash" ]
CMD [ "/start.sh" ]
app.py是我要从那里重新启动tor的rest api代码
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。