forked from Unidata/ldm-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
141 lines (91 loc) · 2.14 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
###
# LDM base dockerfile
###
FROM centos:7
###
# Update the system. Install stuff.
###
RUN yum update yum
# clean up (optimize now)
RUN yum install -y wget pax gcc libxml2-devel make libpng-devel rsyslog perl \
zlib-devel bzip2 git curl perl sudo cronie bc net-tools man gnuplot tcl
###
# gosu is a non-optimal way to deal with the mismatches between Unix user and
# group IDs inside versus outside the container resulting in permission
# headaches when writing to directory outside the container.
###
ENV GOSU_VERSION 1.10
ENV GOSU_URL https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-amd64
RUN gpg --keyserver pgp.mit.edu --recv-keys \
B42F6819007F00F88E364FD4036A9C25BF357DD4 \
&& curl -sSL $GOSU_URL -o /bin/gosu \
&& chmod +x /bin/gosu \
&& curl -sSL $GOSU_URL.asc -o /tmp/gosu.asc \
&& gpg --verify /tmp/gosu.asc /bin/gosu \
&& rm /tmp/gosu.asc
###
# Set up ldm user account
###
RUN useradd -ms /bin/bash ldm
RUN echo "ldm ALL=NOPASSWD: ALL" >> /etc/sudoers
RUN echo 'ldm:docker' | chpasswd
###
# LDM version
###
ENV LDM_VERSION 6.13.6
###
# LDM HOME
###
ENV HOME /home/ldm
WORKDIR $HOME
# So crond can run as user ldm
RUN chmod +s /sbin/crond
###
# Install the ldm
###
COPY install_ldm.sh $HOME/
COPY install_ldm_root_actions.sh $HOME/
RUN chmod +x $HOME/install_ldm.sh
RUN chmod +x $HOME/install_ldm_root_actions.sh
RUN $HOME/install_ldm.sh
RUN $HOME/install_ldm_root_actions.sh
###
# crontab for scouring
###
COPY cron/ldm /var/spool/cron/ldm
RUN chown ldm:ldm /var/spool/cron/ldm
RUN chmod 600 /var/spool/cron/ldm
###
# copy scouring utilities
###
COPY util $HOME/util
##
# Set the path
##
ENV PATH $HOME/bin:$PATH
##
# Create ldm directories conistent with registry.xml
##
RUN mkdir -p $HOME/var/queues
# This directory will ultimately be mounted outside the container
RUN mkdir -p $HOME/var/data
##
# Copy over some additional files.
##
COPY runldm.sh $HOME/bin/
RUN chmod +x $HOME/bin/runldm.sh
COPY README.md $HOME/
##
# chown
##
RUN chown -R ldm:ldm $HOME
##
# entrypoint
##
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
##
# Execute script.
##
CMD ["runldm.sh"]