Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qg-dockerfiles
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
qg-dockerfiles
Commits
512451ff
Commit
512451ff
authored
Sep 30, 2017
by
张 斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(properties):构建nginx镜像的dockerfiler修改
parent
3e514391
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
2 deletions
+37
-2
Dockerfile
baseimg/nginx/Dockerfile
+7
-2
auto-reload-nginx.sh
baseimg/nginx/auto-reload-nginx.sh
+30
-0
No files found.
baseimg/nginx/Dockerfile
View file @
512451ff
FROM
nginx
MAINTAINER
kalvin "dekun.dai@quantgroup.cn"
COPY
auto-reload-nginx.sh /home/auto-reload-nginx.sh
RUN
chmod
+x /home/auto-reload-nginx.sh
# install inotify
RUN
apt-get update
&&
apt-get
install
-y
inotify-tools
# #替换源
WORKDIR
/etc/apt/
RUN
mv
sources.list /tmp
...
...
@@ -25,5 +32,3 @@ RUN apt-get update \
&&
curl
-sL
https://deb.nodesource.com/setup_6.x | bash -
\
&&
apt-get
install
--assume-yes
--no-install-recommends
nodejs
\
&&
apt-get clean
CMD
nginx -g 'daemon off;'
\ No newline at end of file
baseimg/nginx/auto-reload-nginx.sh
0 → 100644
View file @
512451ff
#!/bin/sh
# Copyright 2016 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
nginx
"
$@
"
oldcksum
=
`
cksum
/etc/nginx/conf.d/default.conf
`
inotifywait
-e
modify,move,create,delete
-mr
--timefmt
'%d/%m/%y %H:%M'
--format
'%T'
\
/etc/nginx/conf.d/ |
while
read date time
;
do
newcksum
=
`
cksum
/etc/nginx/conf.d/default.conf
`
if
[
"
$newcksum
"
!=
"
$oldcksum
"
]
;
then
echo
"At
${
time
}
on
${
date
}
, config file update detected."
oldcksum
=
$newcksum
nginx
-s
reload
fi
done
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment