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

Improve dockerfile #612

Merged
merged 3 commits into from
Apr 14, 2015
Merged

Improve dockerfile #612

merged 3 commits into from
Apr 14, 2015

Conversation

manbearwiz
Copy link

This significantly simplifies the dockerfile for stackedit by using library/node as its base.

This simplification works because npm install and npm start are called by the base image.

This will always create the container using the source code the dockerfile is "living with" and will not pull from git separately. Versioning is handled by specifying on dockerhub what git tagged versions should be made available.

To test I set up a build repo on dockerhub with several testing tags. If you wanted to set up an "official" stackedit build repo its pretty easy. Just setup the automatic builds as follows, where "Name" is the git tag to use code from and "Docker Tag Name" is the version name used by docker.

Type Name Dockerfile Location Docker Tag Name
Tag master / latest
Tag v4.3.2 / v4.3.2
Tag v4.3.1 / v4.3.1

I believe this really is the best way to do this and should require virtually no future maintenance.

Kevin Brey added 2 commits October 29, 2014 12:46
 - Use docker library version of node
 - Assume dockerfile lives with sourcecode
 - Assume server can be started with `npm start` aka `node server.js`
 - Assumes all dependencies are listed in `package.json`
@manbearwiz
Copy link
Author

You'll notice that in the build history, there are a lot of failed builds. This is due to one build pointing to a nonexistent tag for testing, and 2 of the other tags are failing due to #596.

@benweet
Copy link
Owner

benweet commented Apr 14, 2015

Looks good to me. Could you upgrade to 0.12-onbuild?

@manbearwiz
Copy link
Author

Done. This will now target version 0.12.x of node.

Another option to take into consideration is targeting 0-onbuild or onbuild so that the Dockerbuilds always use the latest node; however, as you probably realize, this would require you to keep up with any possible breaking changes node makes in the future. Either way works for me.

benweet added a commit that referenced this pull request Apr 14, 2015
@benweet benweet merged commit b65cca7 into benweet:master Apr 14, 2015
@benweet
Copy link
Owner

benweet commented Apr 14, 2015

Thx. Just setup a repo in Docker Hub to test that:
https://registry.hub.docker.com/u/benweet/stackedit/

@hacfi
Copy link

hacfi commented Feb 28, 2016

bower install seems to be missing so the image doesn’t work without running it in the container

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.

None yet

3 participants