Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
cld
S
systems
sock-shop
carts
Commits
2892497d
Commit
2892497d
authored
Nov 08, 2016
by
Phil Winder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added user to dockerfile. Set caps on java binary to allow binding to port 80.
parent
fef970e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
docker/cart/Dockerfile
docker/cart/Dockerfile
+17
-0
No files found.
docker/cart/Dockerfile
View file @
2892497d
FROM
java:openjdk-8-alpine
ENV
SERVICE_USER=myuser \
SERVICE_UID=10001 \
SERVICE_GROUP=mygroup \
SERVICE_GID=10001
RUN
addgroup
-g
${
SERVICE_GID
}
${
SERVICE_GROUP
}
&&
\
adduser
-g
"
${
SERVICE_NAME
}
user"
-D
-H
-G
${
SERVICE_GROUP
}
-s
/sbin/nologin
-u
${
SERVICE_UID
}
${
SERVICE_USER
}
&&
\
apk add
--update
libcap
&&
\
mkdir
/lib64
&&
\
ln
-s
/usr/lib/jvm/java-1.8-openjdk/jre/lib/amd64/server/libjvm.so /lib/libjvm.so
&&
\
ln
-s
/usr/lib/jvm/java-1.8-openjdk/lib/amd64/jli/libjli.so /lib/libjli.so
&&
\
setcap
'cap_net_bind_service=+ep'
$(
readlink
-f
$(
which java
))
WORKDIR
/usr/src/app
COPY
*.jar ./app.jar
RUN
chown
-R
${
SERVICE_USER
}
:
${
SERVICE_GROUP
}
./app.jar
USER
${SERVICE_USER}
ARG
BUILD_DATE
ARG
BUILD_VERSION
ARG
COMMIT
...
...
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