Closed pewdeveloper closed 4 years ago
Here is my Dockerfile and docker-compose.yml if anyone wants to try to reproduce:
Dockerfile
FROM bitnami/minideb:stretch
WORKDIR /usr/src/app
RUN install_packages curl ca-certificates
RUN curl -LJ -o ./lfs_server.tar.gz https://github.com/artemkin/git-lfs-server/releases/download/v0.3.1/lfs_server-0.3.1-linux.x64.tar.gz
RUN tar xvf ./lfs_server.tar.gz && mv ./lfs_server/* . && rm -rf ./lfs_server ./lfs_server.tar.gz
RUN apt-get --purge -y remove curl ca-certificates
EXPOSE 55600/tcp
VOLUME /usr/src/app/.lfs/objects
RUN useradd -MUs /bin/bash -d /usr/src/app lfs
RUN chown -R lfs:lfs /usr/src/app
USER lfs
CMD ["./lfs_server.sh", "-p 55600", "-s 0.0.0.0", "-verbose"]
docker-compose.yml
version: "3.3" services:
git-lfs-server:
build: .
image: lfs_server
ports:
- "55600:55600"
volumes:
- <source_directory_for_mounted_volume>:/usr/src/app/.lfs/objects:Z
I was able to resolve this myself.
I tracked down the issue to the call
Unix.rename
For some reason this call fails if the temp dir is outside of your mounted volume. I changed my configuration so the whole .lfs directory is inside the mounted volume and operation returned to normal. Closing now, I hope this can help others in the future.
This issue might not be caused by git-lfs-server but wanted to see if anyone else was struggling with similar problems getting git-lfs-server deployed inside a docker container with a mounted data volume as the objects directory.
This is using git-lfs-server release number 0.3.1
When deploying git-lfs-server in a docker container everything works mostly as expected. However if you try to use a volume to persist data in between container instantiations suddenly this error starts to appear in the logs:
If I check the volume directory it appears that the git-lfs-server can create empty directories but not files. If I log into the container I seem to have all the required permissions to read and write files on the volume mount and can create large test files using dd
After letting the server rest idle for a few minutes this error shows up in the logs:
Here is my git/lfs version information: