Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker: How to add backports to sources.list via Dockerfile?

I need to install ffmeg on debian jessie via Dockerfile.

Debian recommends to use backports. But how do I do this in my Dockerfile?

Add

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

to

/etc/apt/sources.list

This is how my Dockerfile looks like:

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"]
like image 557
user3142695 Avatar asked Sep 25 '17 13:09

user3142695


1 Answers

Tested on Ubuntu 20.04, >> is required when appending to sources.list.

RUN echo 'deb http://deb.debian.org jessie-backports main' >> /etc/apt/sources.list

Other answers create a new flie in /etc/apt/sources.list.d which is OK, but the original question refers to appending to sources.list. Use >> to append to a file.

like image 148
vanboom Avatar answered Sep 26 '22 00:09

vanboom