-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (31 loc) · 1.2 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
# Use an official SQL Server runtime as a parent image
FROM mcr.microsoft.com/mssql/server:2019-CU13-ubuntu-20.04
# Set environment variables for SQL server
ENV ACCEPT_EULA "Y"
ENV SA_PASSWORD "p@ssw0rd"
ENV MSSQL_PID "Standard"
ENV MSSQL_BACKUP_DIR "/sqlbackups"
# Install Samba for integration test linking and
# supervisor to run two programs in one docker container
USER root
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
samba \
supervisor \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Configure Samba shared directory
COPY smb.conf /etc/samba/smb.conf
RUN mkdir -p /sqlbackups && chmod 777 /sqlbackups && chmod 644 /etc/samba/smb.conf
RUN echo "$SA_PASSWORD\n$SA_PASSWORD" | smbpasswd -a -s root
# Expose SMB ports
EXPOSE 137/udp 138/udp 139 445
# Configure supervisor to run SQL and Samba
COPY supervisor.d/*.conf /etc/supervisor/conf.d/
RUN mkdir -p /var/log/supervisor && chmod 644 /etc/supervisor/conf.d/*.conf
# Add Tini
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]
CMD [ "/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf" ]