From 8e3cbd11d3bc4e74e44cb69719ad28914ceacb7c Mon Sep 17 00:00:00 2001 From: Gemfield Date: Mon, 6 Apr 2020 15:52:45 +0000 Subject: [PATCH] Update Dockerfile to 20.04 version --- README.md | 7 +++---- build_docker_images.sh | 7 +++++-- docker/ubuntu16.04/Dockerfile.devel | 7 ++++--- docker/ubuntu16.04/Dockerfile.runtime | 13 +++++++------ docker/ubuntu18.04/Dockerfile.devel | 9 +++++---- docker/ubuntu18.04/Dockerfile.runtime | 13 +++++++------ 6 files changed, 31 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index eb019d28..973d55a0 100644 --- a/README.md +++ b/README.md @@ -140,12 +140,11 @@ ## Docker 镜像 你可以从Docker Hub下载已经编译好的镜像并启动它: ```bash -docker run -id -p 1935:1935 -p 8080:80 gemfield/zlmediakit +docker run -id -p 1935:1935 -p 8080:80 gemfield/zlmediakit:20.04-runtime-ubuntu18.04 ``` -你要可以在Ubuntu 16.04下根据Dockerfile编译镜像: +你也可以根据Dockerfile编译镜像: ```bash -cd docker -docker build -t zlmediakit . +bash build_docker_images.sh ``` ## 使用方法 diff --git a/build_docker_images.sh b/build_docker_images.sh index a642584f..4e8d1620 100644 --- a/build_docker_images.sh +++ b/build_docker_images.sh @@ -1,3 +1,6 @@ #!/bin/bash -docker build -t gemfield/zlmediakit:20.01-runtime-ubuntu18.04 -f docker/ubuntu18.04/Dockerfile.runtime . -#docker build -t gemfield/zlmediakit:20.01-devel-ubuntu18.04 -f docker/ubuntu18.04/Dockerfile.devel . +set -e +docker build -t gemfield/zlmediakit:20.04-runtime-ubuntu18.04 -f docker/ubuntu18.04/Dockerfile.runtime . +docker build -t gemfield/zlmediakit:20.04-devel-ubuntu18.04 -f docker/ubuntu18.04/Dockerfile.devel . +docker build -t gemfield/zlmediakit:20.04-runtime-ubuntu16.04 -f docker/ubuntu16.04/Dockerfile.runtime . +docker build -t gemfield/zlmediakit:20.04-devel-ubuntu16.04 -f docker/ubuntu16.04/Dockerfile.devel . diff --git a/docker/ubuntu16.04/Dockerfile.devel b/docker/ubuntu16.04/Dockerfile.devel index 650bd206..56044904 100644 --- a/docker/ubuntu16.04/Dockerfile.devel +++ b/docker/ubuntu16.04/Dockerfile.devel @@ -23,9 +23,10 @@ RUN apt-get update && \ libmysqlclient-dev \ libx264-dev \ libfaac-dev \ + ffmpeg \ libmp4v2-dev && \ - apt autoremove -y && \ - apt clean -y && \ + apt-get autoremove -y && \ + apt-get clean -y && \ rm -rf /var/lib/apt/lists/* RUN mkdir -p /opt/media @@ -37,7 +38,7 @@ RUN git clone --depth=1 https://github.com/xiongziliang/ZLMediaKit && \ WORKDIR /opt/media/ZLMediaKit/build RUN cmake -DCMAKE_BUILD_TYPE=Release .. && \ - make -j4 + make ENV PATH /opt/media/ZLMediaKit/release/linux/Release/:$PATH CMD MediaServer diff --git a/docker/ubuntu16.04/Dockerfile.runtime b/docker/ubuntu16.04/Dockerfile.runtime index 4bd6382f..a21ec505 100644 --- a/docker/ubuntu16.04/Dockerfile.runtime +++ b/docker/ubuntu16.04/Dockerfile.runtime @@ -24,8 +24,8 @@ RUN apt-get update && \ libx264-dev \ libfaac-dev \ libmp4v2-dev && \ - apt autoremove -y && \ - apt clean -y && \ + apt-get autoremove -y && \ + apt-get clean -y && \ rm -rf /var/lib/apt/lists/* RUN mkdir -p /opt/media @@ -37,7 +37,7 @@ RUN git clone --depth=1 https://github.com/xiongziliang/ZLMediaKit && \ WORKDIR /opt/media/ZLMediaKit/build RUN cmake -DCMAKE_BUILD_TYPE=Release .. && \ - make -j4 + make FROM ubuntu:16.04 LABEL maintainer "Gemfield " @@ -51,12 +51,13 @@ RUN apt-get update && \ libssl-dev \ libx264-dev \ libfaac-dev \ + ffmpeg \ libmp4v2-dev && \ - apt autoremove -y && \ - apt clean -y && \ + apt-get autoremove -y && \ + apt-get clean -y && \ rm -rf /var/lib/apt/lists/* WORKDIR /opt/media/bin/ COPY --from=build /opt/media/ZLMediaKit/release/linux/Release/MediaServer /opt/media/bin/MediaServer ENV PATH /opt/media/bin:$PATH -CMD MediaServer \ No newline at end of file +CMD MediaServer diff --git a/docker/ubuntu18.04/Dockerfile.devel b/docker/ubuntu18.04/Dockerfile.devel index 335c9a3f..3cc05989 100644 --- a/docker/ubuntu18.04/Dockerfile.devel +++ b/docker/ubuntu18.04/Dockerfile.devel @@ -24,9 +24,10 @@ RUN apt-get update && \ libmysqlclient-dev \ libx264-dev \ libfaac-dev \ + ffmpeg \ libmp4v2-dev && \ - apt autoremove -y && \ - apt clean -y && \ + apt-get autoremove -y && \ + apt-get clean -y && \ rm -rf /var/lib/apt/lists/* RUN mkdir -p /opt/media @@ -38,7 +39,7 @@ RUN git clone --depth=1 https://github.com/xiongziliang/ZLMediaKit && \ WORKDIR /opt/media/ZLMediaKit/build RUN cmake -DCMAKE_BUILD_TYPE=Release .. && \ - make -j4 + make ENV PATH /opt/media/ZLMediaKit/release/linux/Release:$PATH -CMD MediaServer \ No newline at end of file +CMD MediaServer diff --git a/docker/ubuntu18.04/Dockerfile.runtime b/docker/ubuntu18.04/Dockerfile.runtime index f10c2658..72095512 100644 --- a/docker/ubuntu18.04/Dockerfile.runtime +++ b/docker/ubuntu18.04/Dockerfile.runtime @@ -24,8 +24,8 @@ RUN apt-get update && \ libx264-dev \ libfaac-dev \ libmp4v2-dev && \ - apt autoremove -y && \ - apt clean -y && \ + apt-get autoremove -y && \ + apt-get clean -y && \ rm -rf /var/lib/apt/lists/* RUN mkdir -p /opt/media @@ -37,7 +37,7 @@ RUN git clone --depth=1 https://github.com/xiongziliang/ZLMediaKit && \ WORKDIR /opt/media/ZLMediaKit/build RUN cmake -DCMAKE_BUILD_TYPE=Release .. && \ - make -j4 + make FROM ubuntu:18.04 LABEL maintainer "Gemfield " @@ -51,12 +51,13 @@ RUN apt-get update && \ libssl-dev \ libx264-dev \ libfaac-dev \ + ffmpeg \ libmp4v2-dev && \ - apt autoremove -y && \ - apt clean -y && \ + apt-get autoremove -y && \ + apt-get clean -y && \ rm -rf /var/lib/apt/lists/* WORKDIR /opt/media/bin/ COPY --from=build /opt/media/ZLMediaKit/release/linux/Release/MediaServer /opt/media/bin/MediaServer ENV PATH /opt/media/bin:$PATH -CMD MediaServer \ No newline at end of file +CMD MediaServer