sbt-native-packager icon indicating copy to clipboard operation
sbt-native-packager copied to clipboard

Update documentation to show how to correctly set permissions to access mapped volumes

Open unoexperto opened this issue 6 years ago • 0 comments
trafficstars

@muuki88 I wish you guys wrote more in documentation because upgrading from .2 to .20 pretty much broke all my builds. Setting dockerPermissionStrategy := DockerPermissionStrategy.None is not helping. I'm still getting Permission denied accessing mapped volumes inside the container.

Plus I don't see why generated Dockerfile sets USER twice. Looks like bug to me

FROM expert/docker-java-minimal:jdk12-alpine
RUN apk update && apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/community mediainfo && /usr/glibc-compat/sbin/ldconfig 
USER root
RUN id -u root 2> /dev/null || useradd --system --create-home --uid 1001 --gid 0 root
WORKDIR /opt/docker
COPY opt /opt
USER 1001
ENTRYPOINT ["/opt/docker/bin/api-server"]
CMD []

with .2 produced file was

FROM expert/docker-java-minimal:jdk12-alpine
RUN apk update && apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/community mediainfo && /usr/glibc-compat/sbin/ldconfig 
WORKDIR /opt/docker
ADD --chown=root:root opt /opt
USER root
ENTRYPOINT ["bin/api-server"]
CMD []

What am I doing incorrectly ? Why COPY opt /opt ? Where does it even take 1001 from ?

My build.sbt is located here https://gist.github.com/unoexperto/626de6bf963b82e66fd016e99b7fe977

unoexperto avatar Apr 12 '19 08:04 unoexperto