Use COPY instead of git clone

This commit is contained in:
Mark Burnett 2017-07-25 20:06:40 -05:00 committed by Alexis Rivera DeLa Torre
parent 721b6de6bf
commit f8ff2c32df
3 changed files with 58 additions and 35 deletions

7
.dockerignore Normal file
View File

@ -0,0 +1,7 @@
.tox
*.egg-info
examples
CODE_OF_CONDUCT.rst
ChangeLog
LICENSE
OWNERS

View File

@ -1,38 +1,40 @@
FROM ubuntu:16.04
MAINTAINER Armada Team
ARG VERSION
ARG REPO
ENV USER=armada \
VERSION=${VERSION:-master} \
REPO=${REPO:-https://github.com/att-comdev/armada.git}
RUN apt-get update -yqq && \
apt-get install -yqq \
build-essential \
git \
git-review \
python-virtualenv \
python-dev \
python-pip \
gcc \
libssl-dev \
libffi-dev \
libgit2-dev
RUN git clone -b $VERSION $REPO ${HOME}/armada
WORKDIR /root/armada
RUN pip install -r requirements.txt \
&& sh tools/libgit2.sh \
&& pip install --upgrade urllib3 \
&& pip install pygit2==0.25.0 \
&& pip install -e .
EXPOSE 8000
ENTRYPOINT ["./entrypoint.sh"]
CMD ["server"]
ENV \
LIBGIT_VERSION=0.25.0 \
USER=armada
RUN apt-get update -y && \
apt-get install -y --no-install-recommends \
build-essential \
gcc \
git \
git-review \
libffi-dev \
libgit2-dev \
libssl-dev \
netbase \
python-dev \
python-pip \
python-virtualenv \
&& mkdir -p /root/armada/tools
WORKDIR /root/armada
COPY ./tools/libgit2.sh /root/armada/tools
RUN /root/armada/tools/libgit2.sh
COPY requirements.txt /root/armada
RUN pip install --upgrade setuptools urllib3 \
&& pip install -r requirements.txt pygit2==$LIBGIT_VERSION
COPY . /root/armada
RUN pip install -e .

View File

@ -1,12 +1,27 @@
#!/bin/sh
set -ex
# Ubuntu 16.04 Install only
apt install git cmake make wget -y
apt-get install -y python-dev libffi-dev libssl-dev libxml2-dev libxslt1-dev libssh2-1 libgit2-dev python-pip libgit2-24
apt-get install -y pkg-config libssh2-1-dev libhttp-parser-dev libssl-dev libz-dev
apt-get update
apt-get install -y \
cmake \
git \
libffi-dev \
libssh2-1 \
libssh2-1-dev \
libssl-dev \
libxml2-dev \
libxslt1-dev \
libz-dev \
make \
pkg-config \
python-dev \
python-pip \
wget
LIBGIT_VERSION='0.25.0'
LIBGIT_VERSION=${LIBGIT_VERSION:-'0.25.0'}
wget https://github.com/libgit2/libgit2/archive/v${LIBGIT_VERSION}.tar.gz
tar xzf v${LIBGIT_VERSION}.tar.gz
@ -14,5 +29,4 @@ cd libgit2-${LIBGIT_VERSION}/
cmake .
make
make install
pip install pygit2==${LIBGIT_VERSION}
ldconfig