Skip to content
This repository was archived by the owner on Jan 24, 2018. It is now read-only.

Script CMD in Dockerfile and command after creation #198

Open
YannickB opened this issue Jan 11, 2017 · 4 comments
Open

Script CMD in Dockerfile and command after creation #198

YannickB opened this issue Jan 11, 2017 · 4 comments

Comments

@YannickB
Copy link
Owner

Hello all,

I am working on the docker compose for Clouder, using our images.

The main problem I am facing is the fact I have to replace the variable in config https://github.com/clouder-community/clouder/blob/master/clouder_template_odoo/images/odoo-data/odoo.conf#L14, which are currently done by Clouder https://github.com/clouder-community/clouder/blob/master/clouder_template_odoo/template.py#L61. Of course, for the docker-compose we don't have a Clouder to execute them.

Maybe there is a way to execute theses commands in the docker-compose, but I guess we should instead set them in environnement variable, and run a script on CMD which will replace the variable in config if they are not set, then run odoo-server.py

That said... I really dislike the idea of a script in CMD. I know everyone is using it, but I think it's poor design. If I do this in the odoo images we'll probably use them in all other Clouder images, do we have any other alternatives ? thoughts ?

@lasley
Copy link
Contributor

lasley commented Jan 11, 2017

Script in CMD is totally bad practice at least from what I've seen. Any scripts should be a part of the entrypoint, trigger upon conditions. The CMD should simply expose the service that is being offered in the container IMO. Otherwise you can't work in your container without triggering a bunch of crap.

Could we not just use environment variables and interpolate them with the existing environment when we copy the conf over? Although in that instance, we would want to use build args instead because the interpolation is on build and not run.

Take a look at @yajo's work in docker-odoo-base. He has variable interpolation happening there & is using env:

Files here will be environment-variable-expanded and concatenated in

@YannickB
Copy link
Owner Author

Yeah I agree we shall use ENTRYPOINT. Thanks for the example.

@lasley
Copy link
Contributor

lasley commented Jan 18, 2017

Curious - did this end up working? I'm about to need something similar I think

@YannickB
Copy link
Owner Author

Unfortunately I don't know yet :/, I set aside the compose for now to concentrate on the oneclick debug.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants