Skip to content

Dockerify #3292

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

Merged
merged 22 commits into from
Feb 16, 2018
Merged

Dockerify #3292

merged 22 commits into from
Feb 16, 2018

Conversation

msmith-techempower
Copy link
Member

@msmith-techempower msmith-techempower commented Feb 15, 2018

Switches the suite to using Docker. Initially this breaks everything except gemini and gemini-mysql which were used as proofs of concept.

Addresses #1, #2, #3, #4, #5, #6, #8, #9, #10, #11, #15, #16, #17, #18

@@ -0,0 +1,18 @@
FROM resin:latest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm reading in the Docker docs that

Each FROM instruction clears any state created by previous instructions.

Does that mean FROM is basically single inheritance? If yes, then how would I declare multiple dependencies?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and you cannot; instead, you chain the inheritance. I have not yet seen a need for multiple inheritance, but if we have one we can probably just tackle it via having some redundant installs in docker images (not great, but not terrible).

ADD Source/ /gemini/Source
ADD build.xml /gemini/
ADD ivy.xml /gemini/
ADD ivysettings.xml /gemini/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is copying files in TFB into the docker container, right? Would something like ADD ./ impl also work, if the goal was to copy everything in the framework's directory into the container? I'm thinking it would be nice to be able to copy and paste this part from framework to framework without worrying about individual files like we are here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should work. I was trying to keep things clean for my POC.


EXPOSE 8080

CMD ["resinctl", "-conf", "/gemini/Docroot/WEB-INF/resin.xml", "console"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is our general guideline for when to use RUN or CMD? Is it: Use RUN for every bash shell command involved in setup except the last one, and use CMD for the last bash command that launches the server?

Copy link
Member Author

@msmith-techempower msmith-techempower Feb 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RUN is only used for setup; it will not actually run and persist a process. See this comment for an example.

CMD is what is executed when we start the container. This version does not execute a shell, but it could have just as well been CMD resin -conf /gemini/Docroot/WEB-INF/resin.xml console and that would have invoked /bin/sh resin -conf ... (the reaper will clean this either way. For instances where we need to run multiple processes (like PHP using php-fpm and nginx) we should be able to get away with CMD php-fpm ... && nginx ...

@msmith-techempower
Copy link
Member Author

Woo, gemini and gemini-mysql passed in Travis-CI (gemini-postgres failed because I didn't implement it yet).

LGTM and start building out the rest!

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

Successfully merging this pull request may close these issues.

3 participants