Gurobi with Docker Image

ยอดดู 701 ครั้ง
ข้ามไปที่ข้อความที่ยังไม่อ่านรายการแรก

Akhilesh Soni

ยังไม่อ่าน,
22 มี.ค. 2562 17:19:3622/3/62
ถึง Gurobi Optimization
Hi,
I am trying to build a docker image based on python and integrating Gurobi with that. Can someone provide any insight as of how to proceed?

Akhilesh Soni

ยังไม่อ่าน,
22 มี.ค. 2562 17:41:0622/3/62
ถึง Gurobi Optimization

FROM python:3.6

COPY gurobi8.1.0_linux64.tar.gz /

RUN tar -xzf /gurobi8.1.0_linux64.tar.gz -C /opt/ \
  && python :/opt/gurobi810/linux64/setup.py install 
ENV PATH $PATH:/opt/gurobi810/linux64/bin

I started with python as a base image and copied gurobi zip file. The process runs as fllowing:
Step 1/5 : FROM python:3.6
 ---> 70f6aab434cf
Step 2/5 : MAINTAINER Akhilesh Soni
 ---> Using cache
 ---> 998a0c3fd988
Step 3/5 : COPY gurobi8.1.0_linux64.tar.gz /
 ---> Using cache
 ---> 69284ff22a6f
Step 4/5 : RUN tar -xzf /gurobi8.1.0_linux64.tar.gz -C /opt/   && python :/opt/gurobi810/linux64/setup.py install
 ---> Running in 9e33d51227e3
python: can't open file ':/opt/gurobi810/linux64/setup.py': [Errno 2] No such file or directory
The command '/bin/sh -c tar -xzf /gurobi8.1.0_linux64.tar.gz -C /opt/   && python :/opt/gurobi810/linux64/setup.py install' returned a non-zero code: 2

Michel Jaczynski

ยังไม่อ่าน,
22 มี.ค. 2562 17:55:4522/3/62
ถึง Gurobi Optimization
Hi Akhilesh,

You may have an extra ':' in your command.

Here is what I usually do:

FROM python:3.6
COPY gurobi8.1.0_linux64.tar.gz /tmp
RUN mkdir -p /opt && tar xfz /tmp/gurobi8.1.0_linux64.tar.gz -C /opt
ENV GUROBI_HOME /opt/gurobi810/linux64
ENV PATH $PATH:$GUROBI_HOME/bin
ENV LD_LIBRARY_PATH $GUROBI_HOME/lib
RUN cd $GUROBI_HOME && python setup.py install

Note that in order to use Gurobi in a Docker container, you will need to use one of these options:
- a token server running outside Docker (floating license) 
- or compute server running outside Docker (compute server license),
- or Gurobi Instant Cloud (cloud license).

Michel Jaczynski

Akhilesh Soni

ยังไม่อ่าน,
22 มี.ค. 2562 18:31:4422/3/62
ถึง Gurobi Optimization

Thanks, Michel. Yes : was redundant but I got the same error even after removing : I am not sure what am I doing wrong.

However, I tried with your code and I got the error "No License Found". Hence, I think at least the image creation went fine.
We are going to use a token server running outside Docker(floating license).

Thanks for your prompt response. 
ตอบทุกคน
ตอบกลับผู้สร้าง
ส่งต่อ
ข้อความใหม่ 0 รายการ