Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
[dockerfile_for_local_execution] Integrated PR feedback
Browse files Browse the repository at this point in the history
Clean up container after each command
  • Loading branch information
oskarpearson committed Apr 14, 2015
1 parent 75e5276 commit 43e957f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions docker/Dockerfile
Expand Up @@ -2,6 +2,8 @@ FROM ubuntu:14.04

MAINTAINER WebOps MoJ <platforms@digital.justice.gov.uk>

# Common tool that we can use to clean up the container after commands, but
# before the layer commit
ADD docker/clean-up-docker-container /usr/local/bin/

# Support tools for building Python apps
Expand All @@ -13,30 +15,32 @@ ADD docker/clean-up-docker-container /usr/local/bin/
# - git
# - libgit2-dev
# - libffi-dev
# - libssh2-1
# - libyaml-dev
# Specific packages for libgit2:
# - cmake
# - python-git
RUN apt-get update && apt-get install -y \
build-essential python-dev python-setuptools \
git libgit2-dev libffi-dev libyaml-dev \
git libffi-dev libssh2-1 libssh2-1-dev libyaml-dev \
cmake && \
clean-up-docker-container
/usr/local/bin/clean-up-docker-container

# Install libgit2 - http://www.pygit2.org/install.html
RUN mkdir /tmp/libgit2
WORKDIR /tmp/libgit1
ADD https://github.com/libgit2/libgit2/archive/v0.22.0.tar.gz /tmp/libgit1/
RUN tar zxf v0.22.0.tar.gz
# Perform the build
# Perform the build. Run ldconfig to add the new file to the library index.
WORKDIR /tmp/libgit1/libgit2-0.22.0
RUN cmake . && make && make install && clean-up-docker-container
RUN cmake . && make && make install && ldconfig && /usr/local/bin/clean-up-docker-container

WORKDIR /
RUN easy_install pip
RUN easy_install pip && /usr/local/bin/clean-up-docker-container

# Copy and work on just the requirements.txt file, so that the 'pip install' step is cacheable
COPY requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt && /usr/local/bin/clean-up-docker-container

WORKDIR /usr/src/bootstrap_cfn
COPY . /usr/src/bootstrap_cfn
2 changes: 1 addition & 1 deletion docker/clean-up-docker-container 100644 → 100755
Expand Up @@ -4,4 +4,4 @@ apt-get -y autoremove --purge
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
truncate -s 0 /var/log/*log

exit 0
exit 0

0 comments on commit 43e957f

Please sign in to comment.