Warm tip: This article is reproduced from serverfault.com, please click

linux-Docker:如何通过 Dockerfile 向 sources.list 添加向后移植?

(linux - Docker: How to add backports to sources.list via Dockerfile?)

发布于 2017-09-25 13:49:23

我需要ffmeg通过 Dockerfile安装在 debian jessie 上。

Debian 建议使用向后移植。但是我如何在我的 Dockerfile 中做到这一点?

添加

deb http://httpredir.debian.org/debian jessie-backports main non-free
deb-src http://httpredir.debian.org/debian jessie-backports main non-free

/etc/apt/sources.list

这是我的 Dockerfile 的样子:

FROM node:4.8-slim

COPY . /

## How to add backports to list ???

RUN apt-get update && apt-get install ffmpeg && ffmpeg -i

RUN (cd programs/server && npm install --silent)
CMD ["node", "main.js"]
Questioner
user3142695
Viewed
0
Tarun Lalwani 2017-09-25 22:00:20

你可以通过添加以下内容来完成

RUN printf "deb http://httpredir.debian.org/debian jessie-backports main non-free\ndeb-src http://httpredir.debian.org/debian jessie-backports main non-free" > /etc/apt/sources.list.d/backports.list