Open RodrigoDornelles opened 11 months ago
I have the same problem using podman and running as non-root (inside the container/build process, I am root, but I run docker build
as non-root user). When building my dockerfile, I get the described permission errors. Running the build as root
works, but I'd prefer building using a non-root user...
Were you able to fix this?
I have the same issue as well. Running as root
does not fix it for me.
@vbrandl @mcmah309 I have an opensource docker image that works around this problem.
podman run --rm -v /tmp:/tmp -v $(pwd):/app -w /app rodrigodornelles/sdkman:latest
sdk install java 17.0.9-oracle
fei 3.13.9
flutter pub get
flutter build apk
You're the man! :raised_hands:
I pulled your solution out into a script that works on my container instance
#!/bin/bash
# `./fvm_tar_workaround.sh on` # To install the custom tar
# `./fvm_tar_workaround.sh off` # To remove the custom tar
set -euo pipefail
install_custom_tar() {
# Create the custom tar script with the flag as default
echo -e "#!/bin/bash\nset -e\n/bin/tar \"\$@\" --no-same-owner" > /tmp/tar
chmod +x /tmp/tar
if [ ! -d /usr/local/bin ]; then
mkdir -p /usr/local/bin
fi
mv /tmp/tar /usr/local/bin/tar
if ! echo "$PATH" | grep -q "/usr/local/bin"; then
echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
fi
if which tar | grep -q "/usr/local/bin/tar"; then
echo "Custom tar command installed successfully."
else
echo "Failed to install the custom tar command."
fi
}
uninstall_custom_tar() {
if [ -f /usr/local/bin/tar ]; then
rm /usr/local/bin/tar
echo "Custom tar command removed successfully."
else
echo "Custom tar command is not installed."
fi
}
if [ "$1" == "on" ]; then
install_custom_tar
elif [ "$1" == "off" ]; then
uninstall_custom_tar
else
echo "Usage: $0 {on|off}"
exit 1
fi
I'm not familiar with the fvm implementation, so not sure what needs to get done on that side to fix this bug
I don't know if it's a problem with flutter or fvm, but using only flutter had no problems.
Before creating a bug report please make check the following
fvm doctor
if possible and add the output to the issue.Describe the bug I can install flutter but not use it normally
To Reproduce fvm install 3.13.9 fvm use 3.13.9 fvm pub get
Expected behavior Normal use
Logs
Desktop (please complete the following information):
Additional context running in docker as root