-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chanjo Dockerfile #218
Chanjo Dockerfile #218
Conversation
This is the super basic docker image. Then I'll try to simulate a database connection using another container in another PR. By the way do we have some test data? @moonso does chanjo work with MariaDB? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great @northwestwitch !
# Run commands as non-root user | ||
RUN adduser -D worker | ||
RUN chown worker:worker -R /home/worker | ||
USER worker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
USER worker | |
USER worker | |
ENTRYPOINT = ["chanjo"] | |
CMD = ["--help"] |
By doing this one can run the container with
docker run --name chanjo
And then use arguments of course
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion! I'll fix it as you say, but without committing exactly your suggestion (you've got an extra = after ENTRYPOINT that breaks the command)
Yes there are test data under
I don't really know, but I guess that if sqlalchemy can run with MariaDB then Chanjo can |
@moonso I've fixed as you suggested, adding ENTRYPOINT and CMD and it works. The problem is that when you run the container it executes the commands and then exits (as expected), so you can't for instance execute any other commands on it. Whenever you use the RUN command you are actually creating a new container and it's not what we want with this app right? I think we want the container to persist, so we can execute commands whenever we want. Any suggestion? |
Great job @northwestwitch ! No I think that this is exactly the behaviour that we want for a container that is running a cli. Usually they are executed with the parameter |
Ah ok, then this container does exactly that! Merging! 👍 |
Tested by @henrikstranneheim in the MIP workflow and it works: |
fix #217
This PR adds | fixes:
How to prepare for test:
docker build -t chanjo:latest .
docker run chanjo
Expected outcome:
Review:
This version is a: