How to optimize dockerfile to avoid stuck when stop a container?

Viewed 22

I wrote a dockerfile to build a clashserver in ubuntu container. However, when I tried to stop the container, the docker just got stuck. There is no any error code or any answer from the terminal. I think some disharmony command appeared in the dockerfile. This is my dockerfile:

FROM ubuntu:latest

RUN cp /etc/apt/sources.list /etc/apt/sources.list.backup \
    && apt-get update -y \
    && apt-get upgrade -y \
    && apt-get clean \
    && apt-get autoclean \


COPY clash-linux-amd64 /bin/clash_run

RUN mkdir  /etc/clash \
    && chmod +x /bin/clash_run 

EXPOSE 7890
EXPOSE 7891
EXPOSE 9090

CMD ["/bin/clash_run","-d","/etc/Clash/"]

If you want to pull the docker image:cfbsks/clash_ubuntu:v0.1

0 Answers
Related