点亮的背景...... 这是我的Dockerfile中的一段代码。我想将我的应用部署到谷歌应用引擎。不知怎的,我无法安装ffmpeg。
ENV VIRTUAL_ENV /env
ENV PATH /env/bin:$PATH
RUN apt-get install ffmpeg
这是错误日志:
E: Unable to locate package ffmpeg
The command '/bin/sh -c apt-get install ffmpeg' returned a non-zero code: 100
ERROR
ERROR: build step "gcr.io/cloud-builders/docker@sha256:ef2e6744a171cfb0e8a0ef27f9b9a34970341bfc0c3d401afdeedca72292cf73" failed: exit status 100
我发现了这个,但它对我不起作用。它抱怨 add-apt-repository 是无效的命令。 https://askubuntu.com/questions/691109/how-do-i-install-ffmpeg-and-codecs
任何人都可以帮我这个吗?感谢!!!
答案 0 :(得分:7)
我知道这有点晚了但原来的答案不适用于Docker。
我做了一个image that has ffmpeg included,可以得到你想要的东西。但是,如果您已经有了基本图像,则可以添加此
RUN apt-get -y update && apt-get install -y wget nano git build-essential yasm pkg-config
# Compile and install ffmpeg from source
RUN git clone https://github.com/FFmpeg/FFmpeg /root/ffmpeg && \
cd /root/ffmpeg && \
./configure --enable-nonfree --disable-shared --extra-cflags=-I/usr/local/include && \
make -j8 && make install -j8
# If you want to add some content to this image because the above takes a LONGGG time to build
ARG CACHEBREAK=1
从源代码安装ffmpeg。如果你走这条路线,我强烈建议你制作一个包含这个的基本图像,因为图像大小超过GB,需要大约5分钟才能构建。
答案 1 :(得分:6)
要使用add-apt-repository
命令,您需要:
apt-get install software-properties-common
这适用于Ubuntu 14.04
和16.04
。
sudo add-apt-repository ppa:mc3man/trusty-media
sudo apt-get update
sudo apt-get install ffmpeg
或者您可以使用here中的最新官方静态版本。