Skip to content
This repository was archived by the owner on Dec 8, 2025. It is now read-only.

apk add docker-cli instead of docker.#4

Merged
rcdailey merged 1 commit intorcdailey:masterfrom
Clewsy:testing_docker-cli
Jan 21, 2020
Merged

apk add docker-cli instead of docker.#4
rcdailey merged 1 commit intorcdailey:masterfrom
Clewsy:testing_docker-cli

Conversation

@Clewsy
Copy link

@Clewsy Clewsy commented Jan 20, 2020

Hello rcdailey, I'm a fan of your nextcloud-cronjob image and have been using it for the better part of a year for my own nextcloud deployment.

In developing my own container image (for simplifying/automating nextcloud data and database backups) I learned that for my purposes I can "apk add docker-cli" instead of "apk add docker".

I think this could be of benefit for nextcloud-cronjob. As far as I can tell, the only reason to add docker is to use docker exec to run the cron.php script.

I have tested this change and it appears to run fine. The benefit on my system is an image reduction from 324MB down to 83MB.

This is my first pull request so I'd be greatful for any feedback!

@rcdailey
Copy link
Owner

rcdailey commented Jan 20, 2020

I'm not familiar with docker-cli. Can you explain the benefits of using it over the docker package? Thanks for your PR.

EDIT: Looks like it's just the docker client, whereas the docker package contains the daemon which we don't need for my image. Is that the case?

@Clewsy
Copy link
Author

Clewsy commented Jan 21, 2020

Yes! When you add docker, docker-cli is one of it's dependencies. The advantage of just installing docker-cli is that it won't install un-needed dependencies (e.g. docker-engine which requires containerd as you noted), thus reducing total image size.

An alternative could be to change the base image to alpinelinux/docker-cli (https://hub.docker.com/r/alpinelinux/docker-cli) - I think the end result should be the same.

@rcdailey
Copy link
Owner

Can you describe any testing you have done with your change? Specifically did you look at logs to make sure that the cron tasks are still executed? Thanks again.

@Clewsy
Copy link
Author

Clewsy commented Jan 21, 2020

That's exactly how I tested it. I left "docker-compose logs -f" running and observed "> Running Script: run-cron-php.sh > Done" every 5 minutes as per my docker-compose.yml configuration.

@rcdailey
Copy link
Owner

Thanks for the improvement. I'll go ahead and get it merged. I did look into alphinelinux/docker-cli but the change you have is sufficient. I personally like the explicit package manager usage for this. The 1 package isn't complicated enough to warrant a completely different base image. I also like having control over using the latest alpine image.

Thanks again for your contribution.

@rcdailey rcdailey merged commit e90dcc6 into rcdailey:master Jan 21, 2020
@Clewsy
Copy link
Author

Clewsy commented Jan 21, 2020

Great! I agree with your comments about staying with the standard alpine image, I went the same way with my own project.

Thanks for the great image.

@Clewsy Clewsy deleted the testing_docker-cli branch January 22, 2020 03:01
@Clewsy Clewsy restored the testing_docker-cli branch January 22, 2020 03:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants