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

update dockerfile to jdk8 and cleanup build #390

Merged
merged 2 commits into from
Jan 4, 2016
Merged

Conversation

byxorna
Copy link
Contributor

@byxorna byxorna commented Dec 30, 2015

@tumblr/systems This dockerfile has gone unloved for a while, so I thought I would simplify and cleanup some. This appears to improve startup times drastically (not writing GC logs to the overlay FS helps :P). JDK bumped to 8, activator to 1.3.7.

CMD ["/usr/bin/java","-server","-Dconfig.file=/opt/collins/conf/production.conf","-Dhttp.port=9000","-Dlogger.file=/opt/collins/conf/logger.xml","-Dnetworkaddress.cache.ttl=1","-Dnetworkaddress.cache.negative.ttl=1","-Dcom.sun.management.jmxremote","-Dcom.sun.management.jmxremote.port=3333","-Dcom.sun.management.jmxremote.authenticate=false","-Dcom.sun.management.jmxremote.ssl=false","-XX:MaxPermSize=384m","-XX:+CMSClassUnloadingEnabled","-XX:+PrintGCDetails","-XX:+PrintGCTimeStamps","-XX:+PrintGCDateStamps","-XX:+PrintTenuringDistribution","-XX:+PrintHeapAtGC","-Xloggc:/var/log/collins/gc.log","-XX:+UseGCLogFileRotation","-cp","/opt/collins/lib/*","play.core.server.NettyServer","/opt/collins"]
# expose HTTP, JMX
EXPOSE 9000 3333
CMD ["/usr/bin/java","-server","-Dconfig.file=/opt/collins/conf/production.conf","-Dhttp.port=9000","-Dlogger.file=/opt/collins/conf/logger.xml","-Dnetworkaddress.cache.ttl=1","-Dnetworkaddress.cache.negative.ttl=1","-Dcom.sun.management.jmxremote","-Dcom.sun.management.jmxremote.port=3333","-Dcom.sun.management.jmxremote.authenticate=false","-Dcom.sun.management.jmxremote.ssl=false","-XX:MaxPermSize=384m","-XX:+CMSClassUnloadingEnabled","-cp","/opt/collins/lib/*","play.core.server.NettyServer","/opt/collins"]
Copy link
Contributor

Choose a reason for hiding this comment

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

can this extremely long line be split to multiple lines please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, actually. Dockerfile syntax requires it is on one line :(

@roymarantz
Copy link
Contributor

👍 assuming it works :-)

MAINTAINER Gabe Conradi <[email protected]>

RUN apt-get update && apt-get install -y zip unzip && rm -r /var/lib/apt/lists/*

RUN useradd -Ur -d /opt/collins collins
RUN for dir in /build /build/collins /var/log/collins /var/run/collins; do mkdir $dir; chown collins $dir; done
ENV ACTIVATOR_VERSION 1.3.7
Copy link

Choose a reason for hiding this comment

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

Feels a little off to have this env var sitting around, since it's not used for anything except building the container. What about moving it to the top of the RUN section, rather than having it as a global ENV?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

SGTM

@lpstein
Copy link

lpstein commented Dec 30, 2015

LGTM aside from that one comment I left. Breaking out ACTIVATOR_VERSION is a nice touch.

@byxorna
Copy link
Contributor Author

byxorna commented Dec 31, 2015

@lpstein ive updated with your suggestion, thanks!

RUN wget -q http://downloads.typesafe.com/typesafe-activator/1.3.6/typesafe-activator-1.3.6-minimal.zip -O /build/typesafe-activator-1.3.6-minimal.zip && \
unzip -q ./typesafe-activator-1.3.6-minimal.zip && \
RUN cd /build && \
export ACTIVATOR_VERSION=1.3.7 && \
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to be "export"ed or would a simple shell variable set be enough? i.e. is it used by any subprocesses or just the single shell that the RUN uses?

Personally I wouldn't bother doing this since it is pretty buried in the file middle of the file anyway, just inline it in the single place it is used, but YMMV.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doesnt matter. its only within the context of this RUN command, so nothing leaks out into the built image.

byxorna added a commit that referenced this pull request Jan 4, 2016
update dockerfile to jdk8 and cleanup build
@byxorna byxorna merged commit 71d789a into master Jan 4, 2016
@william-richard william-richard deleted the gabe-dockerfile-revamp branch April 26, 2016 19:22
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