Skip to content
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

configure.sh script fails when deploying a springboot app #420

Open
isalkovic opened this issue Nov 12, 2021 · 6 comments
Open

configure.sh script fails when deploying a springboot app #420

isalkovic opened this issue Nov 12, 2021 · 6 comments

Comments

@isalkovic
Copy link

Hello,

I have a problem when building image to include a springboot app.
Don't know if this is a bug, or if I am making some stupid mistake...

Here is the error:
#14 48.82 chmod: changing permissions of '/opt/ibm/wlp/usr/servers/defaultServer/dropins/spring': Operation not permitted

executor failed running [/bin/sh -c configure.sh]: exit code: 123

Dockerfile:
FROM websphere-liberty:21.0.0.9-full-java8-ibmjava as staging
COPY --chown=1001:0 tf-nobkhnd.jar /staging/myFatApp.jar
COPY --chown=1001:0 server.xml /config/
RUN springBootUtility thin
--sourceAppPath=/staging/myFatApp.jar
--targetThinAppPath=/staging/myThinApp.jar
--targetLibCachePath=/staging/lib.index.cache
FROM websphere-liberty:21.0.0.9-kernel-java8-ibmjava
COPY --chown=1001:0 server.xml /config
COPY --from=staging /staging/lib.index.cache /lib.index.cache
COPY --from=staging /staging/myThinApp.jar /config/dropins/spring/myThinApp.jar
ARG VERBOSE=true
RUN configure.sh

@leochr
Copy link
Member

leochr commented Feb 2, 2022

@isalkovic Apologies for the delay. Are you still encountering this issue?

@psihovjeverica
Copy link

@leochr I gave up and swithced to one of the Open Liberty profiles where the same approach worked.
If it is important for you I gan dig in to get more details.

@leochr
Copy link
Member

leochr commented Feb 4, 2022

@psihovjeverica Glad that you got it to work. We'll try to reproduce with one of the sample spring app. Thanks.

@leochr
Copy link
Member

leochr commented Feb 4, 2022

@psihovjeverica I managed to reproduce the issue you were hitting by using same Dockerfile above, but with one of our sample spring app.

The permission problem is related to these lines in the Dockerfile:

COPY --from=staging /staging/lib.index.cache /lib.index.cache
COPY --from=staging /staging/myThinApp.jar /config/dropins/spring/myThinApp.jar

I was able to create image successfully after changing the above lines to include --chown=1001:0, like this:

COPY --from=staging --chown=1001:0 /staging/lib.index.cache /lib.index.cache
COPY --from=staging --chown=1001:0 /staging/myThinApp.jar /config/dropins/spring/myThinApp.jar

Explanation:
The configure.sh script tries to change the permission of some folders (after adding new features using installUtility), but it couldn't change permission for the above files, since they were copied as root user (COPY command copies as root-user). We'll evaluate whether permission operation can be scoped down. Open Liberty uses featureUtility and has slightly different scripts, hence you didn't encounter the same issue with it.

@isalkovic
Copy link
Author

isalkovic commented Feb 7, 2022 via email

@leochr
Copy link
Member

leochr commented Feb 7, 2022

@isalkovic You're welcome! Agree, I've already submitted a PR to update the sample Dockerfile (here)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants