-
Notifications
You must be signed in to change notification settings - Fork 78
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
Upgrade to 4.31 causes Permission denied #354
Comments
Hello @geddah, Could you please provide the content for Could you please also provide the full Thanks! |
Hey @jandroav. Thank you for the quick reply. Here's the docker file:
create-liquibase-props.sh is populating the properties file '/liquibase/config/liquibase.properties', Contents inside create-liquibase-props.sh:
|
Hello @geddah I was locally testing it with your files and I was not able to reproduce it so I believe it is related to the specific Kubernetes environment. I could see the following when executing this command using your
In Kubernetes, stricter permission handling or different runtime configurations might result in the Permission denied error, especially when the container runs as a non-root user (1001 in this case). Could you please add ![]() Please let me know how it goes and we can further troubleshoot it. Regards, |
Hello @jandroav. Apologies for the delayed response.
We are running the liquibase container as another user with UID 1337(not 1001 nor root). When I configure the I will do some more digging as to why the same configuration does not throw any errors with previous versions of liquibase. Thanks!!! |
hey @geddah this can be related to #355 Previously, we did not specify
Now that the home directory is explicitly created, it is likely that:
|
That makes sense. Thanks!! |
Just wanted to make sure if this is a good approach for a custom image after the changes in FROM docker.io/liquibase/liquibase:4.31
COPY changelog /liquibase/changelogs/db/changelog
WORKDIR /liquibase/changelogs
ENV CHANGELOG_FILE "db/changelog/db.changelog-master.yaml"
# Set user to root to fix permissions
USER root
# Ensure the liquibase binary is executable for all users
RUN chmod +x /liquibase/liquibase && chown -R 999:999 /liquibase
# Set user back to 999 for security
USER 999
CMD ["sh", "-c", "\
liquibase update \
--changelogFile=$CHANGELOG_FILE \
--url=$DB_URL \
--username=$DB_LIQUIBASE_USERNAME \
--password=$DB_LIQUIBASE_PASSWORD"] In the k8s deployment I'm using runAsGroup: 999
runAsNonRoot: true
runAsUser: 999 Thanks for your support 🙂 ! |
Helo @Sax388, Your approach looks solid, and using |
Steps to reproduce:
Upgrade liquibase to 4.31
Getting the following log when running liquibase as one of the init-containers in kubernetes 1.29:
/bin/bash: /liquibase/docker-entrypoint.sh: Permission denied
We are using liquibase as a base image for our init container.
Using the following command to to run the docker image:
CMD ["sh", "-c", "./create-liquibase-props.sh && docker-entrypoint.sh --defaultsFile=config/liquibase.properties update"]
We verified the above command works until v4.30
The text was updated successfully, but these errors were encountered: