使用docker制作自启
Dockerfile
#!/bin/bash
FROM amd64/ubuntu:18.04
RUN ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo Asia/Shanghai > /etc/timezone
ENV LANG C.UTF-8
RUN mkdir -p /home/zhy/
COPY /home/zhy/ffmpeg_start.sh /home/zhy/ffmpeg_start.sh
RUN sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list && \
apt-get clean && \
apt-get update --fix-missing && \
apt-get install -y ffmpeg
# --- install requirements ---
WORKDIR /data/code
RUN chmod +x /home/zhy/ffmpeg_start.sh
# --- running service ---
CMD /bin/bash /home/zhy/ffmpeg_start.sh
docker build -t ImageName:TagName dir
docker run -itd --name use_ffmpeg_start --restart=always ffmpeg_sh:v1
I can feel you forgetting me。。 有一种默契叫做我不理你,你就不理我