I have a Dockerfile with an anonymous volume like this:
...
RUN adduser -D nonrootuser
RUN chown nonrootuser /app/log
USER nonrootuser
VOLUME /app/log
WORKDIR /app
COPY --from=build a/app.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java","-jar","/app/app.jar"]
When my app starts it can't write to /app/log. How should I solve this? I want to have an anonymous volume and not a named one.