-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
48 lines (38 loc) · 1.32 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
FROM debian:latest
MAINTAINER Alex Moiseenko <[email protected]>
ENV DIR_NAME=bacula-dir
ENV DB_NAME=bacula
ENV DB_USER=bacula
ENV DB_PASS=password
ENV PATH /opt/bacula/etc:$PATH
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y wget gcc g++ make file git libmysqlclient-dev mysql-client && \
mkdir /opt/bacula && \
git clone http://git.bacula.org/bacula bacula && \
cd bacula/bacula && \
./configure \
--enable-smartalloc \
--enable-batch-insert \
--with-mysql \
--sbindir=/opt/bacula/bin \
--sysconfdir=/opt/bacula/etc \
--with-pid-dir=/opt/bacula/working \
--with-subsys-dir=/opt/bacula/working \
--with-working-dir=/opt/bacula/working \
--disable-build-stored \
--with-x=NO && \
make && make install && \
# Add custom user config catalog
mkdir /opt/bacula/etc/conf.d /opt/bacula/data && \
echo "@|\"sh -c 'for f in /opt/bacula/etc/conf.d/*.conf ; do echo @\$\{f\} ; done'\"" >> /opt/bacula/etc/bacula-dir.conf && \
# Clean system from useless files
apt-get remove wget gcc g++ make file git libmysqlclient-dev sqlite3 bacula-common-pgsql libpq-dev -y && \
apt-get clean all && \
rm -rf bacula
VOLUME /opt/bacula/etc/conf.d
VOLUME /opt/bacula/data
COPY entrypoint.sh /opt/bacula/
RUN chmod 755 /opt/bacula/entrypoint.sh
ENTRYPOINT ["/opt/bacula/entrypoint.sh"]
CMD ["bacula-dir"]
EXPOSE 9101 9102 9103