-
Notifications
You must be signed in to change notification settings - Fork 259
/
Dockerfile.build
56 lines (49 loc) · 1.57 KB
/
Dockerfile.build
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Spreed WebRTC server Docker builder
#
# This Dockerfile creates a container which builds Spreed WebRTC as found in the
# current folder, and creates a tarball which can be piped into another Docker
# container for creating minimal sized Docker containers.
#
# First create the builder image:
#
# ```
# docker build -t spreed-webrtc-builder -f Dockerfile.build .
# ```
# Next run the builder container, piping its output into the creation of the
# runner container. This creates a minimal size Docker image which can be used
# to run Spreed WebRTC in production.
#
# ```
# docker run --rm spreed-webrtc-builder | docker build -t spreed-webrtc -f Dockerfile.run -
# ```
FROM ubuntu:xenial
MAINTAINER Simon Eisenmann <[email protected]>
# Set locale.
RUN locale-gen --no-purge en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV DEBIAN_FRONTEND noninteractive
# Base build dependencies.
RUN apt-get update && apt-get install -qy \
golang \
nodejs \
build-essential \
git \
automake \
autoconf
# Add and build Spreed WebRTC server.
ADD . /srv/spreed-webrtc
WORKDIR /srv/spreed-webrtc
RUN mkdir -p /usr/share/gocode/src
RUN ./autogen.sh && \
./configure && \
make pristine && \
make get && \
make tarball
RUN rm /srv/spreed-webrtc/dist_*/*.tar.gz
RUN mv /srv/spreed-webrtc/dist_*/spreed-webrtc-* /srv/spreed-webrtc/dist
# Add gear required by Dockerfile.run.
COPY Dockerfile.run /
COPY scripts/docker_entrypoint.sh /
# Running this image produces a tarball suitable to be piped into another
# Docker build command.
CMD tar -cf - -C / Dockerfile.run docker_entrypoint.sh /srv/spreed-webrtc/dist