Files
ortools-clone/tools/docker/debian-9.Dockerfile
Corentin Le Molgat 7f6dcf4b31 Rework Docker
- Add ubuntu-18.04
- add pkg-config to ubuntu(s)
- Rework Docker Makefile
- Add test job to verify archive
  - Add cc.Dockerfile
  - Add java.Dockerfile
  - Add dotnet.Dockerfile
- Build ortools in docker_<lang>
- Build archive and fz_archive in two separate containers
- Add dependencies to makefiles when building docker image
- Suppress previous archive if any
- Improve docker build by using export/archive when building language images
- Reduce build context using export/$* instead of .
  note: when running `docker build ... foo`, all files in `foo` are recursively
  send to the docker daemon before building. Since we have tons of Go of images
  it could take time to "upload".
2018-07-17 15:08:13 +02:00

63 lines
2.1 KiB
Docker

FROM debian:9
#############
## SETUP ##
#############
RUN apt-get update -qq \
&& apt-get install -qq \
git pkg-config wget make cmake autoconf libtool zlib1g-dev gawk g++ curl subversion \
swig lsb-release \
python-dev python-wheel python-setuptools python-six \
python3-dev python3-wheel python3-setuptools \
default-jdk \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Dotnet Install
RUN apt-get update -qq \
&& apt-get install -qq gpg apt-transport-https \
&& wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg \
&& mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/ \
&& wget -q https://packages.microsoft.com/config/debian/9/prod.list \
&& mv prod.list /etc/apt/sources.list.d/microsoft-prod.list \
&& apt-get update -qq \
&& apt-get install -qq dotnet-sdk-2.1 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Mono Install
#RUN apt-get install -qq apt-transport-https dirmngr \
#&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \
#&& echo "deb https://download.mono-project.com/repo/debian stable-stretch main" | tee /etc/apt/sources.list.d/mono-official-stable.list \
#&& apt-get update -qq \
#&& apt-get install -qq mono-complete \
#&& apt-get clean \
#&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENV TZ=America/Los_Angeles
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
################
## OR-TOOLS ##
################
ARG SRC_GIT_BRANCH
ENV SRC_GIT_BRANCH ${SRC_GIT_BRANCH:-master}
ARG SRC_GIT_SHA1
ENV SRC_GIT_SHA1 ${SRC_GIT_SHA1:-unknown}
# Download sources
# use SRC_GIT_SHA1 to modify the command
# i.e. avoid docker reusing the cache when new commit is pushed
WORKDIR /root
RUN git clone -b "${SRC_GIT_BRANCH}" --single-branch https://github.com/google/or-tools \
&& echo "sha1: $(cd or-tools && git rev-parse --verify HEAD)" \
&& echo "expected sha1: ${SRC_GIT_SHA1}"
# Prebuild
WORKDIR /root/or-tools
RUN make detect && make third_party
RUN make detect_cc && make cc
RUN make detect_python && make python
RUN make detect_java && make java
RUN make detect_dotnet && make dotnet