-
Notifications
You must be signed in to change notification settings - Fork 208
/
Dockerfile
35 lines (27 loc) · 972 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# pull base image
FROM ubuntu:22.04 AS build
LABEL stage=intermediate
ARG FF_VER=shared
# install packaged dependencies
RUN apt-get update && [ "$FF_VER" = 'shared' ] && \
apt-get -y install --no-install-recommends libavformat-dev libavcodec-dev libavutil-dev g++ make git || \
apt-get -y install --no-install-recommends yasm wget g++ make git ca-certificates xz-utils && \
rm -rf /var/lib/apt/lists/*
# copy code
ADD . /untrunc-src
WORKDIR /untrunc-src
# build untrunc
#RUN /usr/bin/g++ -o untrunc *.cpp -lavformat -lavcodec -lavutil
RUN /usr/bin/make FF_VER=$FF_VER && strip untrunc
# deliver clean image
FROM ubuntu:22.04
ARG FF_VER=shared
RUN apt-get update && [ "$FF_VER" = 'shared' ] && \
apt-get -y install --no-install-recommends libavformat58 libavcodec58 libavutil56 && \
rm -rf /var/lib/apt/lists/* || true
COPY --from=build /untrunc-src/untrunc /bin/untrunc
# non-root user
RUN useradd untrunc
USER untrunc
# execution
ENTRYPOINT ["/bin/untrunc"]