UNCLASSIFIED
Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Ironbank Containers
DIAT
AAP Mongo
Commits
8358eb0c
Commit
8358eb0c
authored
Aug 23, 2021
by
WingKwan Lau
Browse files
Update Dockerfile, scripts/createuser.sh, hardening_manifest.yaml files
parent
e511954f
Pipeline
#439054
passed with stages
in 6 minutes and 10 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
6 deletions
+24
-6
Dockerfile
Dockerfile
+7
-4
hardening_manifest.yaml
hardening_manifest.yaml
+2
-2
scripts/createuser.sh
scripts/createuser.sh
+15
-0
No files found.
Dockerfile
View file @
8358eb0c
...
...
@@ -18,6 +18,9 @@ RUN mkdir -p $WORKING_DIR
# copy over the script to make permissions compatible with OpenShift
COPY
scripts/fix-permissions.sh /usr/local/bin
# copy create user script
COPY
scripts/createuser.sh /docker-entrypoint-initdb.d/
# ensure the script is executable
RUN
chmod
a+x /usr/local/bin/fix-permissions.sh
...
...
@@ -26,12 +29,12 @@ RUN fix-permissions.sh ${DATA_DIR} -P && \
fix-permissions.sh
${
CONFIG_DIR
}
-P
&&
\
fix-permissions.sh
${
WORKING_DIR
}
-P
RUN
ls
-ltrh
${
DATA_DIR
}
RUN
ls
-ltrh
${
CONFIG_DIR
}
RUN
ls
-ltrh
${
WORKING_DIR
}
# set home directory to persistent volume directory
ENV
HOME=/var/lib/mongodb/data
# ensure folder is writable
RUN
chown
-R
mongodb:mongodb /usr/local/bin
# switch back to mongodb (for non-containerized environments)
USER
mongodb:mongodb
hardening_manifest.yaml
View file @
8358eb0c
...
...
@@ -7,7 +7,7 @@ name: "diat/aap-mongo"
# The most specific version should be the first tag and will be shown
# on ironbank.dso.mil
tags
:
-
"
1
4
.1"
-
"
1
5
.1"
-
"
latest"
# Build args passed to Dockerfile ARGs
...
...
@@ -29,7 +29,7 @@ labels:
# Name of the distributing entity, organization or individual
org.opencontainers.image.vendor
:
"
aap-mongo"
# Authoritative version of the software
org.opencontainers.image.version
:
"
1
4
.1"
org.opencontainers.image.version
:
"
1
5
.1"
# Keywords to help with search (ex. "cicd,gitops,golang")
mil.dso.ironbank.image.keywords
:
"
aap,mongo,aap-mongo,aapmongo,mongodb,aap-mongodb,atlas,diat"
# This value can be "opensource" or "commercial"
...
...
scripts/createuser.sh
0 → 100644
View file @
8358eb0c
#!/bin/sh
echo
"Initializing database
$MONGO_INITDB_DATABASE
and creating database user
$MONGODB_USER
"
mongo
=(
mongo
--host
127.0.0.1
--port
27017
--quiet
)
"
${
mongo
[@]
}
"
"
$MONGO_INITDB_DATABASE
"
<<-
EOJS
db.createUser({
user:
$(
_js_escape
"
$MONGODB_USER
"
)
,
pwd:
$(
_js_escape
"
$MONGODB_PASSWORD
"
)
,
roles: [ { role: 'readWrite', db:
$(
_js_escape
"
$MONGO_INITDB_DATABASE
"
)
} ]
})
EOJS
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