forked from Sitecore/docker-images
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
66 lines (51 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
ARG BASE_IMAGE
FROM $BASE_IMAGE as builder
USER root
RUN apt-get -y update \
&& apt-get -y --allow-unauthenticated install unzip \
&& wget -progress=bar:force -q -O sqlpackage.zip https://go.microsoft.com/fwlink/?linkid=2113331 \
&& unzip -qq sqlpackage.zip -d /opt/sqlpackage \
&& chmod +x /opt/sqlpackage/sqlpackage
# install pwsh
RUN wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb \
&& dpkg -i packages-microsoft-prod.deb \
&& apt-get update \
&& apt-get install -y powershell \
&& pwsh -command "Set-PackageSource -Name PSGallery -Trusted ; Install-Module -Name SqlServer"
COPY *.zip /opt/wdp/
COPY InstallShards.ps1 /opt
COPY install-databases.sh /opt
COPY replace_log.sh /opt
RUN unzip -qq /opt/wdp/Sitecore*.zip -d /opt/wdp/ \
&& ls /opt/wdp \
&& unzip -qq /opt/wdp/Sitecore*_cm.scwdp.zip -d /opt/wdp/cm/ \
&& unzip -qq /opt/wdp/*xp1collection.scwdp.zip -d /opt/wdp/xp1collection/
ENV ACCEPT_EULA='Y' \
SA_PASSWORD='envy-$taleness-Jelly-3twin-aided-Sterile-Bawd' \
MSSQL_PID=Developer
RUN ( /opt/mssql/bin/sqlservr & ) | grep -q "Service Broker manager has started" \
&& chmod +x /opt/replace_log.sh \
&& chmod +x /opt/install-databases.sh \
&& ./opt/install-databases.sh /opt/wdp/cm \
&& pwsh /opt/InstallShards.ps1 -SqlServer . -SqlAdminUser sa -SqlAdminPassword $SA_PASSWORD -SqlElasticPoolName xp -ResourcesDirectory /opt/wdp/xp1collection/ \
&& pkill sqlservr \
&& /opt/replace_log.sh
FROM $BASE_IMAGE
USER root
COPY --from=builder ["/var/opt/mssql/data/Sitecore*", "/clean/"]
COPY boot.sh /opt/
COPY attach-databases.sh /opt/
COPY install-databases.sh /opt/
RUN chmod +x /opt/boot.sh && \
chmod +x /opt/attach-databases.sh && \
chmod +x /opt/install-databases.sh && \
chmod -R 777 /clean && \
mkdir -p /var/opt/mssql/data && \
chmod -R 777 /var/opt/mssql/data
ENV ACCEPT_EULA='Y' \
SA_PASSWORD='envy-$taleness-Jelly-3twin-aided-Sterile-Bawd' \
MSSQL_PID=Developer \
MSSQL_DATA_DIR=/var/opt/mssql/data \
MSSQL_LOG_DIR=/var/opt/mssql/data
USER mssql
ENTRYPOINT ["/opt/boot.sh", "/clean", "/var/opt/mssql/data"]