I’ve created a dockerfile that uses svn export to pull a tar.gz and then unpack it. During the dockerfile image build, it correctly exports the file and unpacks it. However, the resulting folder is nowhere to been seen. It’s like it just gets deleted as soon as it’s created but looking through the logs, it wasn’t it’s just gone.
If I copy the run command from the dockerfile and run it via cli w/in a container, it works correctly and leaves the resulting folders where it should be.
I’m out of ideas and am hoping someone else has an idea for this.
Thanks ahead of time to anyone willing to help.
Possible for you to share the Dockerfile you speak of? Are you executing
svn export as part of the Docker image build using
RUN in the Dockerfile? I’m sure there’s a perfectly reasonable explanation for this behavior.
My supervisor had an idea that worked but I’ll share anyway as I’m curious if I had missed something.
The lines w/the issue are were like this:
RUN mkdir /file/path/ && cd /file/path
RUN svn export file-name-here.tar.gz --username xxx --password xxx && tar -zxvf file-name-here.tar.gz
That’s the gist of it at least. The export and tar would work but the expectant resulting file from the untar was nonexistent on any container w/that image as base.
To fix it I had to combine the above lines:
RUN mkdir /file/path/ && cd /file/path && svn export file-name-here.tar.gz --username xxx --password xxx && tar -zxvf file-name-here.tar.gz
That works as expected.
To change the current directory for subsequent commands, use the
WORKDIR command, e.g.:
RUN mkdir /file/path WORKDIR /file/path RUN svn export ...
Great! Thanks for the information. I’ll alter my file and try that. Much appreciated.