Skip to content
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

Added docker #186

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Added docker #186

wants to merge 2 commits into from

Conversation

francisbesset
Copy link
Contributor

I purpose to add docker to build quickly the Curvytron server!

To build:

(curvytron) $ docker build -t curvytron .

To run:

$ docker run --name curvytron -p 80:8080 curvytron

Also, you can add this repository in Docker Hub to use docker pull.

Kiss 💋

@Tom32i
Copy link
Contributor

Tom32i commented May 11, 2015

Awesome 👏

@tristanbes
Copy link

yay

@emerick42
Copy link

Are you sure it's a good practice to RUN a single command combined with logical &&? Also I think the dependencies installation step should be done before the ADD, so it can be cached properly.

@francisbesset
Copy link
Contributor Author

@emerick42 Good point!
But the first Dockerfile built an image with a size of 303.4 MB.
If I separate RUN to optimize the cache of different step, I have an image with a size of 537.6 MB.

@emerick42
Copy link

Do you know why the container is larger?

@francisbesset
Copy link
Contributor Author

Yes! Docker works same that git. Each statement (RUN, ENV, EXPOSE, CMD, ....) is committed.
If you commit a statement, you commit the state of container.

In fact, the first Dockerfile, add dependencies in container but the dependencies are removed in same statement.
In second Dockerfile, the first RUN statement is committed with dependencies.

You can use docker history curvytron to see each commit.

@emerick42
Copy link

Ok, I got it. I think the second option is better, at least to respect Docker's way of doing things. Did you check on other official images if they were doing optimizations like this one?

@francisbesset
Copy link
Contributor Author

The last version is better to rebuild quickly a new container. It's ~230 MB additional.
To download the initial image from Docker Hub isn't dramatic.

@dbrgn dbrgn mentioned this pull request Sep 17, 2015
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.

4 participants