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
e2b6c3e5
Commit
e2b6c3e5
authored
Nov 15, 2017
by
张 斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mongodb 修改
parent
f1b7dfde
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
Dockerfile
baseimg/mongodb/Dockerfile
+1
-1
docker-entrypoint.sh
baseimg/mongodb/docker-entrypoint.sh
+7
-7
No files found.
baseimg/mongodb/Dockerfile
View file @
e2b6c3e5
...
@@ -27,7 +27,7 @@ WORKDIR /home/quant_group/mongodb
...
@@ -27,7 +27,7 @@ WORKDIR /home/quant_group/mongodb
RUN
mkdir
data config
\
RUN
mkdir
data config
\
&&
chown
-R
mongodb:mongodb /home/quant_group/mongodb/data /home/quant_group/mongodb/config
&&
chown
-R
mongodb:mongodb /home/quant_group/mongodb/data /home/quant_group/mongodb/config
VOLUME
/
data/db /data/configdb
VOLUME
/
home/quant_group/mongodb/data /home/quant_group/mongodb/config
COPY
docker-entrypoint.sh ./docker-entrypoint.sh
COPY
docker-entrypoint.sh ./docker-entrypoint.sh
...
...
baseimg/mongodb/docker-entrypoint.sh
View file @
e2b6c3e5
...
@@ -11,7 +11,7 @@ originalArgOne="$1"
...
@@ -11,7 +11,7 @@ originalArgOne="$1"
# all mongo* commands should be dropped to the correct user
# all mongo* commands should be dropped to the correct user
if
[[
"
$originalArgOne
"
==
mongo
*
]]
&&
[
"
$(
id
-u
)
"
=
'0'
]
;
then
if
[[
"
$originalArgOne
"
==
mongo
*
]]
&&
[
"
$(
id
-u
)
"
=
'0'
]
;
then
if
[
"
$originalArgOne
"
=
'mongod'
]
;
then
if
[
"
$originalArgOne
"
=
'mongod'
]
;
then
chown
-R
mongodb /
data/configdb /data/db
chown
-R
mongodb /
home/quant_group/mongodb/config /home/quant_group/mongodb/data
fi
fi
# make sure we can write to stdout and stderr as "mongodb"
# make sure we can write to stdout and stderr as "mongodb"
...
@@ -133,10 +133,10 @@ if [ "$originalArgOne" = 'mongod' ]; then
...
@@ -133,10 +133,10 @@ if [ "$originalArgOne" = 'mongod' ]; then
# check for a few known paths (to determine whether we've already initialized and should thus skip our initdb scripts)
# check for a few known paths (to determine whether we've already initialized and should thus skip our initdb scripts)
if
[
-n
"
$shouldPerformInitdb
"
]
;
then
if
[
-n
"
$shouldPerformInitdb
"
]
;
then
for
path
in
\
for
path
in
\
/
data/db
/WiredTiger
\
/
home/quant_group/mongodb/data
/WiredTiger
\
/
data/db
/journal
\
/
home/quant_group/mongodb/data
/journal
\
/
data/db
/local.0
\
/
home/quant_group/mongodb/data
/local.0
\
/
data/db
/storage.bson
\
/
home/quant_group/mongodb/data
/storage.bson
\
;
do
;
do
if
[
-e
"
$path
"
]
;
then
if
[
-e
"
$path
"
]
;
then
shouldPerformInitdb
=
shouldPerformInitdb
=
...
@@ -167,8 +167,8 @@ if [ "$originalArgOne" = 'mongod' ]; then
...
@@ -167,8 +167,8 @@ if [ "$originalArgOne" = 'mongod' ]; then
# https://github.com/docker-library/mongo/issues/164#issuecomment-293965668
# https://github.com/docker-library/mongo/issues/164#issuecomment-293965668
_mongod_hack_ensure_arg_val
--logpath
"/proc/
$$
/fd/1"
"
${
mongodHackedArgs
[@]
}
"
_mongod_hack_ensure_arg_val
--logpath
"/proc/
$$
/fd/1"
"
${
mongodHackedArgs
[@]
}
"
else
else
echo
>
&2
"warning: initdb logs cannot write to '/proc/
$$
/fd/1', so they are in '/
data/db
/docker-initdb.log' instead"
echo
>
&2
"warning: initdb logs cannot write to '/proc/
$$
/fd/1', so they are in '/
home/quant_group/mongodb/data
/docker-initdb.log' instead"
_mongod_hack_ensure_arg_val
--logpath
/
data/db
/docker-initdb.log
"
${
mongodHackedArgs
[@]
}
"
_mongod_hack_ensure_arg_val
--logpath
/
home/quant_group/mongodb/data
/docker-initdb.log
"
${
mongodHackedArgs
[@]
}
"
fi
fi
_mongod_hack_ensure_arg
--logappend
"
${
mongodHackedArgs
[@]
}
"
_mongod_hack_ensure_arg
--logappend
"
${
mongodHackedArgs
[@]
}
"
...
...
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