Skip to content

Add git to the docker image#1967

Open
xduugu wants to merge 1 commit intoKozea:masterfrom
xduugu:docker-git
Open

Add git to the docker image#1967
xduugu wants to merge 1 commit intoKozea:masterfrom
xduugu:docker-git

Conversation

@xduugu
Copy link

@xduugu xduugu commented Jan 21, 2026

This is required to version collections with git as described in the tutorial at https://radicale.org/v3.html#versioning-collections-with-git .

This is required to version collections with git as described in the tutorial
at https://radicale.org/v3.html#versioning-collections-with-git .
@pbiering pbiering added the packaging:container related to container packaging label Jan 21, 2026
@kalsi-avneet
Copy link
Collaborator

Thank you for the PR. I will review it this weekend.

@kalsi-avneet kalsi-avneet self-assigned this Jan 22, 2026
@kalsi-avneet
Copy link
Collaborator

@xduugu ,

Thank you for raising this PR. I understood your requirements from #1745 (reply in thread) :

... my storage hook did not work anymore, because git is not installed in the image. I created #1967 which fixes this remaining issue for me. ...

I am curious about what other changes might be required apart from installing git inside the docker container.

I built the image with the changes in this PR, and started the docker container. I got this error:

[ERROR] Execution of storage hook not successful: Command 'git add -A && (git diff --cached --quiet || git commit -m "Changes by \"test-user\"")' returned non-zero exit status 128.

Here is my compose file:

services:
    radicale:
        image: radicale:test-git-hook
        ports:
        - "5232:5232"
        volumes:
        - "./config:/etc/radicale"
        - "./data:/var/lib/radicale"

this is my config/config file:

[auth]
type = none

[storage]
filesystem_folder = /var/lib/radicale/collections/
filesystem_cache_folder = /var/lib/radicale/collections/
use_cache_subfolder_for_item = True
use_cache_subfolder_for_history = True
use_cache_subfolder_for_synctoken = True
hook = git add -A && (git diff --cached --quiet || git commit -m "Changes by \"%(user)s\"")

On rebuilding with the --debug flag, I got this:

...

...                         [1/Thread-6 (process_request_thread)] [DEBUG] Captured stderr from storage hook:
radicale-1  | Author identity unknown
radicale-1  | 
radicale-1  | *** Please tell me who you are.
radicale-1  | 
radicale-1  | Run
radicale-1  | 
radicale-1  |   git config --global user.email "you@example.com"
radicale-1  |   git config --global user.name "Your Name"
radicale-1  | 
radicale-1  | to set your account's default identity.
radicale-1  | Omit --global to set the identity only in this repository.
radicale-1  | 
radicale-1  | fatal: unable to auto-detect email address (got 'radicale@31c8c0dc0f26.(none)')

...

I am interested in knowing how you avoided this error. Did you configure git inside the container by running docker compose exec ..., bind-mount your host's .gitconfig or resolve this in some other way? I believe this information might be useful for new users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packaging:container related to container packaging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments