Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi-stage dockerfile #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 22 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
# Alpine Dockerfile for building locally / pushing to Dockerhub
FROM alpine:3.16
# syntax=docker/dockerfile:1
FROM alpine:3.16 AS builder

# install dependencies
RUN buildDeps="bash-completion \
cmake \
coreutils \
gcc \
g++ \
gdb \
git \
make \
curl-dev" && \
apk add --update ${buildDeps}
# Install dependencies
ARG build_deps="bash-completion cmake coreutils gcc g++ gdb git make curl-dev"
RUN apk --no-cache add --update ${build_deps}

# Pull fmp4ingest-tools repo
RUN cd /root && \
git clone --recurse-submodules https://github.com/unifiedstreaming/fmp4-ingest.git && \
cd fmp4-ingest/ingest-tools && \
cmake CMakeLists.txt && \
make
# Pull fmp4-ingest tools repo
WORKDIR /root/
RUN git clone --recurse-submodules https://github.com/unifiedstreaming/fmp4-ingest.git
WORKDIR /root/fmp4-ingest/ingest-tools/event/
RUN git pull https://github.com/unifiedstreaming/EventMessageTrack.git master

# Build fmp4-ingest tools
WORKDIR /root/fmp4-ingest/
RUN cmake -S . -B build
RUN cmake --build build --clean-first

# Create lean fmp4-ingest container image
FROM alpine:3.16

ARG runtime_deps="gcc curl-dev"
RUN apk --no-cache add --update ${runtime_deps}
WORKDIR /root/fmp4-ingest/
COPY --from=builder /root/fmp4-ingest/build ./
ENV PATH="${PATH}:/root/fmp4-ingest/ingest-tools:/root/fmp4-ingest/ingest-tools/event"

# Invocation examples
Expand Down
2 changes: 1 addition & 1 deletion ingest-tools/event
Submodule event updated from 3d0273 to a09b61