Skip to content

Commit 4bec2d9

Browse files
committed
[jenkins] change to new style; up to 2.121.3.
[nginx] change to new style dockerfile. added support for sites-enabled, sites-available, with default.conf and minimum nginx.conf
1 parent 3519098 commit 4bec2d9

File tree

4 files changed

+90
-21
lines changed

4 files changed

+90
-21
lines changed
Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,35 @@
1+
# escape=`
2+
13
FROM microsoft/windowsservercore:10.0.14393.2312
24
LABEL maintainer="xied75@gmail.com"
35

4-
ENV JENKINS_VERSION=2.121.1 JENKINS_HOME=C:/JENKINS_HOME
6+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
57

6-
EXPOSE 8080 50000
7-
VOLUME C:/JENKINS_HOME
8+
ENV JENKINS_VERSION=2.121.3 JENKINS_HOME=C:/JENKINS_HOME
89

910
COPY noStart.mst C:/
1011

11-
RUN powershell -Command \
12-
Invoke-WebRequest -UseBasicParsing -Uri "https://dotnetbinaries.blob.core.windows.net/servicemonitor/2.0.1.3/ServiceMonitor.exe" -OutFile \ServiceMonitor.exe; \
13-
Invoke-WebRequest http://mirrors.jenkins-ci.org/windows-stable/jenkins-%JENKINS_VERSION%.zip -OutFile \jenkins-%JENKINS_VERSION%.zip; \
14-
Expand-Archive -Path \jenkins-%JENKINS_VERSION%.zip -DestinationPath /; \
15-
Start-Process -FilePath msiexec.exe -ArgumentList /i, jenkins.msi, TRANSFORMS=noStart.mst, /qn, /L, jenkins.install.log -PassThru -Wait; \
16-
rm \jenkins-%JENKINS_VERSION%.zip; \
17-
rm \jenkins.msi; \
18-
rm \noStart.mst; \
19-
$xml = (Get-Content \"%ProgramFiles(x86)%\Jenkins\Jenkins.xml\") -as [Xml]; \
20-
$xml.service.env.value = \"%JENKINS_HOME%\"; \
21-
$xml.Save(\"%ProgramFiles(x86)%\Jenkins\Jenkins.xml\");
12+
RUN `
13+
# Install Portable Git
14+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
15+
Invoke-WebRequest -UseBasicParsing https://github.com/git-for-windows/git/releases/download/v2.18.0.windows.1/PortableGit-2.18.0-64-bit.7z.exe -OutFile PortableGit-2.18.0-64-bit.7z.exe; `
16+
Start-Process -FilePath PortableGit-2.18.0-64-bit.7z.exe -ArgumentList '-y', '-InstallPath="C:\\PortableGit"' -NoNewWindow -PassThru -Wait; `
17+
Remove-Item PortableGit-2.18.0-64-bit.7z.exe; `
18+
# Set Path
19+
setx /M PATH $(${Env:PATH} `
20+
+ \";C:\PortableGit\bin\"); `
21+
Invoke-WebRequest -UseBasicParsing -Uri "https://dotnetbinaries.blob.core.windows.net/servicemonitor/2.0.1.3/ServiceMonitor.exe" -OutFile \ServiceMonitor.exe; `
22+
Invoke-WebRequest http://mirrors.jenkins-ci.org/windows-stable/jenkins-$Env:JENKINS_VERSION.zip -OutFile \jenkins-$Env:JENKINS_VERSION.zip; `
23+
Expand-Archive -Path \jenkins-$Env:JENKINS_VERSION.zip -DestinationPath /; `
24+
Start-Process -FilePath msiexec.exe -ArgumentList /i, jenkins.msi, TRANSFORMS=noStart.mst, /qn, /L, jenkins.install.log -PassThru -Wait -NoNewWindow; `
25+
Remove-Item \jenkins-$Env:JENKINS_VERSION.zip; `
26+
Remove-Item \jenkins.msi; `
27+
Remove-Item \noStart.mst; `
28+
$xml = (Get-Content \"${Env:ProgramFiles(x86)}\Jenkins\Jenkins.xml\") -as [Xml]; `
29+
$xml.service.env.value = \"$Env:JENKINS_HOME\"; `
30+
$xml.Save(\"${Env:ProgramFiles(x86)}\Jenkins\Jenkins.xml\");
31+
32+
EXPOSE 8080 50000
33+
VOLUME $JENKINS_HOME
2234

2335
ENTRYPOINT ["C:\\ServiceMonitor.exe", "jenkins"]

windowsservercore/nginx/Dockerfile

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
1+
# escape=`
2+
13
FROM microsoft/windowsservercore:10.0.14393.2312
24
LABEL maintainer="xied75@gmail.com"
35

6+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
7+
48
ENV NGINX_VERSION 1.14.0
59

6-
RUN setx PATH %PATH%;C:\nginx-%NGINX_VERSION%;
7-
EXPOSE 80 443
10+
RUN `
11+
Invoke-WebRequest -UseBasicParsing http://nginx.org/download/nginx-$Env:NGINX_VERSION.zip -outfile \nginx-$Env:NGINX_VERSION.zip; `
12+
Expand-Archive -Path \nginx-$Env:NGINX_VERSION.zip -DestinationPath /; `
13+
Remove-Item /nginx-$Env:NGINX_VERSION.zip; `
14+
New-Item -Type Directory \nginx-$Env:NGINX_VERSION\conf\sites-available; `
15+
New-Item -Type Directory \nginx-$Env:NGINX_VERSION\conf\sites-enabled; `
16+
Rename-Item \nginx-$Env:NGINX_VERSION\conf\nginx.conf nginx.conf.original;
817

9-
RUN powershell -Command \
10-
Invoke-WebRequest http://nginx.org/download/nginx-%NGINX_VERSION%.zip -outfile \nginx-%NGINX_VERSION%.zip; \
11-
Expand-Archive -Path \nginx-%NGINX_VERSION%.zip -DestinationPath /; \
12-
rm /nginx-%NGINX_VERSION%.zip
18+
COPY nginx.conf \nginx-$NGINX_VERSION\conf\
19+
COPY default.conf \nginx-$NGINX_VERSION\conf\sites-enabled\
20+
21+
RUN setx /M PATH $(${Env:PATH} `
22+
+ \";C:\nginx-${Env:NGINX_VERSION}\");
23+
24+
EXPOSE 80 443
1325

1426
WORKDIR C:/nginx-$NGINX_VERSION
1527

16-
CMD c:/nginx-%NGINX_VERSION%/nginx.exe
28+
CMD ["nginx.exe"]
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
server {
2+
listen 80;
3+
server_name localhost;
4+
5+
location / {
6+
root html;
7+
index index.html index.htm;
8+
}
9+
}

windowsservercore/nginx/nginx.conf

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
#user nobody;
3+
worker_processes 1;
4+
5+
#error_log logs/error.log;
6+
#error_log logs/error.log notice;
7+
#error_log logs/error.log info;
8+
9+
#pid logs/nginx.pid;
10+
11+
12+
events {
13+
worker_connections 1024;
14+
}
15+
16+
17+
http {
18+
include mime.types;
19+
default_type application/octet-stream;
20+
21+
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
22+
# '$status $body_bytes_sent "$http_referer" '
23+
# '"$http_user_agent" "$http_x_forwarded_for"';
24+
25+
#access_log logs/access.log main;
26+
27+
sendfile on;
28+
#tcp_nopush on;
29+
30+
#keepalive_timeout 0;
31+
keepalive_timeout 65;
32+
33+
#gzip on;
34+
35+
include sites-enabled/*.conf;
36+
}

0 commit comments

Comments
 (0)