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

merge Dockerfile RUN commands to fix caching issues #2822

Merged
1 commit merged into from
Jan 10, 2018
Merged
Changes from all 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
50 changes: 21 additions & 29 deletions securedrop/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
# ubuntu:14.04 as of 2017-11-15
FROM ubuntu@sha256:f6eed4def93a3b54da920737f0abf1a8cae2e480bb368280c898265fcaf910a3

RUN apt-get update # 2017-11-15
RUN apt-get install -y \
python-pip libpython2.7-dev libssl-dev secure-delete gnupg2 ruby redis-server
# refs securedrop/issues/1594
RUN gem install sass -v 3.4.23

# test requirements:
RUN apt-get install -y firefox
RUN apt-get install -y git xvfb haveged curl gettext paxctl
RUN apt-get install -y x11vnc

# pinned firefox version for selenium compatibility. See bd795e2f5865b4f6e6e1b88bcbbacef704675c74
ENV FIREFOX_CHECKSUM=88d25053306d33658580973b063cd459a56e3596a3a298c1fb8ab1d52171d860

RUN apt-get update && \
apt-get install -y python-pip libpython2.7-dev libssl-dev secure-delete \
gnupg2 ruby redis-server firefox git xvfb haveged curl \
gettext paxctl

RUN gem install sass -v 3.4.23

RUN curl -LO https://launchpad.net/~ubuntu-mozilla-security/+archive/ubuntu/ppa/+build/9727836/+files/firefox_46.0.1+build1-0ubuntu0.14.04.3_amd64.deb && \
shasum -a 256 firefox*deb && \
echo "${FIREFOX_CHECKSUM} firefox_46.0.1+build1-0ubuntu0.14.04.3_amd64.deb" | shasum -a 256 -c - && \
Expand All @@ -23,34 +20,29 @@ RUN curl -LO https://launchpad.net/~ubuntu-mozilla-security/+archive/ubuntu/ppa/
#
# This can be removed when upgrading to something more recent than trusty
#
RUN echo deb http://archive.ubuntu.com/ubuntu/ zesty main > /etc/apt/sources.list.d/zesty.list
RUN apt-get update
RUN apt-get install -y gettext
RUN rm /etc/apt/sources.list.d/zesty.list
RUN apt-get update
RUN echo deb http://archive.ubuntu.com/ubuntu/ zesty main > /etc/apt/sources.list.d/zesty.list && \
apt-get update && \
apt-get install -y gettext && \
rm /etc/apt/sources.list.d/zesty.list && \
apt-get update

COPY requirements requirements
RUN pip install -r requirements/securedrop-app-code-requirements.txt

# test requirements:
RUN pip install -r requirements/test-requirements.txt
RUN pip install -r requirements/securedrop-app-code-requirements.txt && \
pip install -r requirements/test-requirements.txt

WORKDIR /app

COPY static static
COPY sass sass
RUN sass --force --stop-on-error --update sass:static/css --style compressed

RUN mkdir -p /var/lib/securedrop/store /var/lib/securedrop/keys
COPY ./tests/files/test_journalist_key.pub /var/lib/securedrop/keys
RUN gpg --homedir /var/lib/securedrop/keys --import /var/lib/securedrop/keys/test_journalist_key.pub

COPY . /app
COPY static static
COPY sass sass
RUN sass --force --stop-on-error --update sass:static/css --style compressed

RUN make test-config
RUN ./manage.py reset
COPY . /app
RUN make test-config && ./manage.py reset

EXPOSE 8080 8081
EXPOSE 5901
EXPOSE 8080 8081 5901

CMD ["./manage.py", "run"]