-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CUSTCOM-130 Better compatibility of docker images #4594
Conversation
appserver/extras/docker-images/micro/src/main/docker/Dockerfile
Outdated
Show resolved
Hide resolved
DEPLOY_DIR=/opt/payara/deployments | ||
|
||
# Create and set the Payara user and working directory owned by the new user | ||
RUN true \ | ||
&& addgroup payara \ | ||
&& adduser -D -h ${PAYARA_HOME} -H -s /bin/bash payara -G payara \ | ||
&& addgroup --gid 1000 payara \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Evil block - this works in alpine, debian and ubuntu
appserver/extras/docker-images/server-full/src/main/docker/Dockerfile
Outdated
Show resolved
Hide resolved
appserver/extras/docker-images/server-full/src/main/docker/Dockerfile
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The memory changes is part of QACI-40
appserver/extras/docker-images/micro/src/main/docker/Dockerfile
Outdated
Show resolved
Hide resolved
There is no PR, memory changes are not even mentioned in description and finally - Patrik already did it in micro here. So I only updated the full server dockerfile with same settings. |
Use an environment variable to define the MaxRamPercentage as suggested here https://github.com/payara/docker-payaraserver-full/pull/118/files |
This should go to standalone issue and PR, here I only "synchronized" it between containers. At this moment this PR is useful for both Patrik's and my work, other changes should have own issue and also testing. Also I don't think this option is sufficient, there are at least other three extremely important (ie -XX:MaxDirectMemorySize - probably 90% fraction for heap is too much). |
As the author of the mentioned PR: good to know development moved here. What do you want me to do? This stuff is crucial IMHO |
Probably only wait, we did more changes and at this moment we have some internal discussion about it ;) I expect we will push and merge the final version soon, very soon ;) |
Great. I'm really eager to release Dataverse images based on Payara 5 :-) |
appserver/extras/docker-images/micro/src/main/docker/Dockerfile
Outdated
Show resolved
Hide resolved
appserver/extras/docker-images/server-full/src/main/docker/Dockerfile
Outdated
Show resolved
Hide resolved
appserver/extras/docker-images/server-full/src/main/docker/Dockerfile
Outdated
Show resolved
Hide resolved
Jenkins test please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably due to he change from java
to sh
in the entrypoint, this doesn't work anymore.
FROM payara/micro:5.202-SNAPSHOT
ADD testapp.war /opt/payara/deployments
No app is deployed anymore
…ing the MaxRAMPercentage currently. Can be removed later, when upstream merged payara/Payara#4594
The Image for Payara Micro looks good and Application deployment is ok again. But the
|
Nevermind, I used temporary file, and it seems on your computer it cannot be mapped into the container. I will change it to use the target folder instead, I hope it will be enough. |
- adduser has different syntax in each distribution
- it often fails, so you can use only -Ddocker.verbose to watch what it does and to see why it failed. - the url is not filtered from pom.xml file, so you can use another url ie. -Ddocker.keyserver.url=hkp://ipv4.pool.sks-keyservers.net or -Ddocker.keyserver.url=hkp://p80.pool.sks-keyservers.net:80
- all dockerfiles use same mechanisms and conventions - useradd and groupadd are not in alpine by default - adduser and addgroup abbreviated parameters are ambiguous on debian/ubuntu - => removed coreutils dependency, using adduser and addgroup with long params - it is also a bit faster - tested with - mvn clean install -PBuildExtras,BuildDockerImages -pl :docker-images -amd - mvn clean install -PBuildExtras,BuildDockerImages -pl :docker-images -amd -Ddocker.java.repository=adoptopenjdk/openjdk11 -Ddocker.java.tag=x86_64-debian-jdk-11.0.5_10
…entage - it was already used in micro - JDK8 supports it since u191 too
- server-node - no changes, configuration is obtained from DAS - server-full and micro - basic configuration for DAS - MEM_MAX_RAM_PERCENTAGE aka -XX:MaxRAMPercentage - 70% of host memory by default - the rest for OS+NIO+stacks - MEM_XSS aka Xss - default 512k; enough for most applications - micro - JVM_ARGS - possibility to add more JVM options - hint for extending these docker images: read docker create --help
- deployment did not work - extended test to deploy a trivial servlet application
- verification of tini and user management is done only once, then the image is shared - this image has caching enabled by default - only micro has it's own, because it uses leaner jdk image based on alpine - renamed some properties to use common scheme - PayaraServerNodeTest with lower timeouts as it waits for the DAS; if something went wrong, it hanged for too long
I need someone to verify that everything works as expected as I described in the description in other than Linux systems: Mac and Windows. |
Jenkins test please |
- sometimes it was not enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change order of COPY statements to allow better re-usage of layers.
appserver/extras/docker-images/micro/src/main/docker/Dockerfile
Outdated
Show resolved
Hide resolved
appserver/extras/docker-images/server-full/src/main/docker/Dockerfile
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on Windows, passes after small changes:
Had add .gitattributes
for Windows, and brought back CMD
support for Payara Micro.
The necessary changes are in https://github.com/dmatej/Payara/pull/3 |
New shell folder, new .gitattributes
- deploymentDir is now CMD concern, overrideable by user - shell executes exec, so that java becomes the main process of container - shell expansion is not available in CMD, therefore DEPLOY_DIR used expanded, but this is usual Docker behavior
Jenkins test please |
- removed unuseful comments - sync with other docker files - tested - note: even if environment variables are not used here, they may be used by users
Jenkins test please |
MEM_XSS="512k" | ||
ENV PATH="${PATH}:${PAYARA_DIR}/bin" | ||
|
||
ARG TINI_VERSION=v0.18.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heads up that tini v0.19 has been released two days ago.
Releases now offer SHA256 sums, thus easing installation A LOT!
https://github.com/krallin/tini/releases/tag/v0.19.0
See also krallin/tini#153
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we will merge this first and then upgrade this in standalone PR, but thanks for the good news!
Congrats getting this huge PR done and merged 🎉 🥳 |
Description
Important Info
Testing
JDK8
mvn clean install -PBuildExtras,BuildDockerImages -pl :docker-images -amd
JDK11
mvn clean install -PBuildExtras,BuildDockerImages -pl :docker-images -amd -Ddocker.payara.tag=5.202-SNAPSHOT-JDK11 -Ddocker.java.repository=adoptopenjdk/openjdk11 -Ddocker.java.tag=jdk-11.0.6_10-debian-slim
Payara4
mvn clean install -PBuildExtras,BuildDockerImages -pl :docker-images -amd -Dpayara.version=4.1.2.191.14-SNAPSHOT -Ddocker.payara.tag=4.1.2.191.14-SNAPSHOT -Ddocker.payara.rootDirectoryName=payara41 -Ddocker.payara.domainName=payaradomain
Changing env variables, extending
Notes