Open flarcher opened 3 years ago
Hello,
Here is an experiment that seems to be a viable workaround:
tar.sh
acting as a wrapper for the tar
binary:#!/bin/bash
/opt/bin/tar "${@}" --no-same-owner
# Changing default tar options
# (as a workaround for https://github.com/aws/aws-lambda-python-runtime-interface-client/issues/37)
RUN mkdir -p /opt/bin && \
mv /bin/tar /opt/bin/
COPY tar.sh /bin/tar
RUN chmod 755 /bin/tar
# Revert the change on tar
RUN rm -f /bin/tar && mv /opt/bin/tar /bin/
With these changes, the docker build becomes a success 🎉
And it seems that the --no-same-owner
option for the tar command can indeed solve the issue.
However, the Dockerfile
does not look good in my example😐
Another idea would be to use lower UID/GID for the ownership information of files inside the TAR file. I suggest to use UID/GID bigger than 1000 but also less than 65535.
Hello,
I get an error when building my docker image including awslambdaric from a container. I do not get any error when building the image using my locally installed docker daemon, but I get the errors either:
Here is the related part of my Dockerfile:
Here are the pip requirements of the file
/root/pip-requirements2.txt
(no issue about cfnresponse):The related Dockerfile steps are run as
USER root
(it might be important as I understand it).Here are the errors in logs (I skipped some lines in between, but there is actually a line for each extracted file):
Here is my understanding:
tar
command depends if the caller is root or not.I plan to test a change with the use of the
--no-same-owner
option along with thetar
commands involved in preinstall.sh. Does it sound good to you? Am I missing something ?Thanks