forked from zeromq/zproject
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zproject_docker.gsl
58 lines (49 loc) · 1.68 KB
/
zproject_docker.gsl
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
57
58
# Generate docker packaging for project
#
# This is a code generator built using the iMatix GSL code generation
# language. See https://github.com/imatix/gsl for details.
#
# Copyright (c) the Contributors as noted in the AUTHORS file.
# This file is part of zproject.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
register_target ("docker", "packaging for Docker")
.macro generate_docker_file ()
.output "Dockerfile"
FROM ubuntu:trusty
MAINTAINER Benjamin Henrion <[email protected]>
RUN DEBIAN_FRONTEND=noninteractive apt-get update -y -q
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q --force-yes build-essential git-core libtool autotools-dev autoconf automake pkg-config unzip libkrb5-dev cmake
RUN useradd -d /home/zmq -m -s /bin/bash zmq
RUN echo "zmq ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/zmq
RUN chmod 0440 /etc/sudoers.d/zmq
USER zmq
.for use where !optional
WORKDIR /home/zmq
RUN git clone --quiet $(use.repository).git
WORKDIR /home/zmq/$(use.project)
RUN ./autogen.sh 2> /dev/null
RUN ./configure --quiet --without-docs
RUN make
RUN sudo make install
RUN sudo ldconfig
.endfor
WORKDIR /home/zmq
RUN git clone --quiet git://github.com/zeromq/$(project.name:c).git
WORKDIR /home/zmq/$(project.name:c)
RUN ./autogen.sh 2> /dev/null
RUN ./configure --quiet --without-docs
RUN make
RUN sudo make install
RUN sudo ldconfig
.if file.exists ("Dockerfile.in")
$(file.slurp ("Dockerfile.in"))
.endif
.endmacro
function target_docker
if defined (project.repository)
generate_docker_file ()
endif
endfunction