Can Git LFS be added to a machine image?


I’m using circleci/classic:201711-01 on machine executor. Apparently git lfs is not available, and wondering if there’s any plan to add it. Installing git lfs on the fly adds extra 30 seconds which is not great.

And, it’s kind of a related question, I’d like to know what’s the machine executor’s roadmap. It seems it’s not updated for almost a half year.



I just found a good workaround to shorten the installation step. Git LFS actually works with just one file in $PATH, so it can skip regular apt-get install. In the config.yml the step would look like this:

- restore_cache:
      - v1-git-lfs

- run:
    name: "Install git lfs"
    command: |
    if ! [ -x "$(command -v git-lfs)" ]; then
        curl -L -o /tmp/git-lfs.tar.gz \

        tar xf /tmp/git-lfs.tar.gz -C /tmp
        sudo /tmp/git-lfs-2.4.0/

- save_cache:
    key: v1-gif-lfs
      - /usr/local/bin/git-lfs


I think it is possible: try building your own custom image with LFS installed, and then specify the name of the custom image in your config. It will pull from a public or private registry that you specify. See the “custom images” section in the docs.


Custom images is not available for machine :frowning:

I get Specified image is not supported error with one of the pre-built CircleCI docker images.


Ah, righto. I’m in danger of asking an obvious question, but can you use the Docker executor?

Alternatively, 30 seconds is rather hard to improve on, but you could also try making a small image and then launching your own processes inside Docker within a Machine. The delay here would be pulling an image from a remote registry. However, I’ve found I can pull nearly 1G in ~50 seconds, so if you can make a <200M image then that might indeed be faster than what you have now.


I have to use machine as I need the Run privileged containers option available.

Thanks for the workaround! git lfs itself could be containerized.

I still would like to know if there’s any plan updating machine images in the future.


Coolio. If you can base it on Alpine, you might be able to get a very small image. A few of mine are ~50M, and I have several under 100M.