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 src/docker/Dockerfile #83

Merged
merged 6 commits into from
Apr 13, 2016
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions src/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Copyright (c) 2012-2015, jcabi.com
Copy link

Choose a reason for hiding this comment

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

@amihaiemil now we need to upload this image to Docker Hub

Copy link

Choose a reason for hiding this comment

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

@amihaiemil and of course update .rultor.yml to use it

# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met: 1) Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer. 2) Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution. 3) Neither the name of the rultor.com nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
# NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.

FROM ubuntu:14.04
MAINTAINER Yegor Bugayenko <[email protected]>
LABEL Description="This is the image for aether.jcabi.com" Vendor="jcabi.com" Version="1.0"
WORKDIR /tmp

ENV DEBIAN_FRONTEND=noninteractive

# UTF-8 locale
RUN locale-gen en_US en_US.UTF-8
RUN dpkg-reconfigure locales
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

# Basic Linux tools
RUN apt-get update & apt-get install -y \
wget bcrypt curl \
unzip zip \
gnupg gnupg2 \
jq \
bsdmainutils \
libxml2-utils \
build-essential \
automake autoconf

# Git 2.0
RUN apt-get install -y software-properties-common python-software-properties
RUN add-apt-repository ppa:git-core/ppa
RUN apt-get update & apt-get install -y \
git git-core

# SSH Daemon
RUN apt-get install -y ssh && \
mkdir /var/run/sshd && \
chmod 0755 /var/run/sshd

# Ruby
RUN apt-get install -y libmagic-dev zlib1g-dev
RUN apt-add-repository ppa:brightbox/ruby-ng
RUN apt-get update & apt-get install -y \
ruby2.2 ruby2.2-dev
RUN gem update && gem install nokogiri && gem install bundler

# Java
RUN apt-get install -y default-jdk
Copy link

Choose a reason for hiding this comment

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

@amihaiemil what's the Java version 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.

@mkordas According to this http://packages.ubuntu.com/trusty/default-jdk , the default jdk of ubuntu 14.04 is 1.7-51 , but personally I have no guarantee. The author said to reuse Dockerfile from rultor tag 1.61.3, so that's what I did.

Do you think another specific jdk should be used?

Copy link

Choose a reason for hiding this comment

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

@original-brownbear what do you think, should we lock Java version here, or default-jdk is fine?

Choose a reason for hiding this comment

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

@mkordas lock for sure! there is simply no upside to not locking in the build versions 100%. Everything but doing so adds needless risk!

Copy link

Choose a reason for hiding this comment

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

@original-brownbear thanks for confirmation

RUN apt-get install -y gdebi && \
wget --quiet http://ppa.launchpad.net/natecarlson/maven3/ubuntu/pool/main/m/maven3/maven3_3.2.1-0~ppa1_all.deb && \
gdebi --non-interactive maven3_3.2.1-0~ppa1_all.deb && \
ln -s /usr/share/maven3/bin/mvn /usr/bin/mvn && \
rm -rf maven3_3.2.1-0~ppa1_all.deb

# PhantomJS
RUN apt-get install -y phantomjs

# S3cmd for AWS S3 integration
RUN apt-get install -y s3cmd

# NodeJS
RUN apt-get install -y nodejs npm
RUN sudo npm install -g npm
RUN ln -s /usr/bin/nodejs /usr/bin/node

# One more time, right before the end
Copy link

Choose a reason for hiding this comment

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

@amihaiemil why this is needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

@mkordas from what I see in man apt-get those lines update the used sources. Here, I suppose they are used as a safety net, to check for updates one last time. If you think they can be safely deleted, I have nothing against it, but I am not sure about it. Since I'm no expert in linux, I simply did as the issue author said (reused the dockerfile of rultor tag 1.61.3, without the pull and build of rultor).

Copy link

Choose a reason for hiding this comment

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

@amihaiemil OK, let's ask the author

Copy link

Choose a reason for hiding this comment

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

@original-brownbear do you think we should have these lines? what's the purpose of them?

Choose a reason for hiding this comment

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

@mkordas No they are a big anti-pattern when using Docker. You should never run any apt-get upgrade in a container build. This simply causes you to become reliant on the apt package maintainer to stay backwards compatible. Also apt-get upgrade can actually break the build one some base images (short explanation: it may require restarting a service, this is disabled in Debian based base images => broken ).
This is already removed from the Rultor image itself too :)

=> just don't do it lock all versions :)

Copy link

Choose a reason for hiding this comment

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

@original-brownbear I've learnt something new, thank you

RUN apt-get update -y
RUN apt-get upgrade -qq -y

# Clean up
RUN rm -rf /tmp/*
RUN rm -rf /root/.ssh