volta
                                
                                
                                
                                    volta copied to clipboard
                            
                            
                            
                        unable to cache in Docker
I wanted to do some extra caching of volta binaries
FROM --platform=$BUILDPLATFORM eclipse-temurin:21-jdk AS volta
USER ubuntu
ENV VOLTA_HOME=/home/ubuntu/.volta
ENV PATH=$VOLTA_HOME/bin:$PATH
WORKDIR /home/ubuntu/.volta
RUN --mount=type=cache,target=/home/ubuntu/.volta/cache,uid=1000,gid=1000 \
    --mount=type=cache,target=/home/ubuntu/.volta/tools,uid=1000,gid=1000 \
    whoami && \ 
    ls -laR $HOME/ && \
    touch /home/ubuntu/.volta/cache/node/foo.txt &&\
    touch /home/ubuntu/.volta/cache/node/index.json &&\
  curl https://get.volta.sh | bash \
  && volta install node@latest npm@latest \
whoami returns correctly as ubuntu
the touch commands work
but the curl does this
Installing latest version of Volta (2.0.1)
Checking for existing Volta installation
Fetching archive for Linux, version 2.0.1
#=#=###O#-#0.1%#############18.7%########################## 37.0%######################################### 57.7%######################################################## 78.3%###################################################################### 98.5%######################################################################## 100.0%
Creating directory layout
Extracting Volta binaries and launchers
Finished installation. Updating user profile settings.
error: Could not write Node index cache
to /home/ubuntu/.volta/cache/node/index.json
The permissions appear to be correct
/home/ubuntu/.volta/cache/node:
total 8
drwxr-xr-x 2 ubuntu ubuntu 4096 Oct 29 14:27 .
drwxr-xr-x 1 ubuntu ubuntu 4096 Oct 29 14:20 ..
-rw-r--r-- 1 ubuntu ubuntu 0 Oct 29 14:27 foo.txt
-rw-r--r-- 1 ubuntu ubuntu 0 Oct 29 14:27 index.json