使用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
posted @ 2022-10-18 13:38  离人怎挽_wdj  阅读(15)  评论(0编辑  收藏  举报