Skip to content

Commit

Permalink
Merge pull request #66 from blevkovych/feat/scipopt-docker
Browse files Browse the repository at this point in the history
Create public Docker image for SCIPOptSuite
  • Loading branch information
mmghannam authored Nov 10, 2023
2 parents 0379560 + 08062c7 commit 6e2e5a6
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/build_and_push_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build And Push Docker Image

on:
workflow_dispatch:
inputs:
version:
description: 'The version of SCIPOptSuite like #.#.#'
required: true
type: number

env:
IMAGE_NAME: scipoptsuite
REPOSITORY_NAME: scipoptsuite

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set Docker Tags
id: metadata
uses: docker/metadata-action@v5
with:
images: ${{ env.REPOSITORY_NAME }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
type=raw,value=${{ github.event.inputs.version }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.metadata.outputs.tags }}
build-args: TAG=${{ github.event.inputs.version }}
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM debian:bullseye-slim

ARG DEBIAN_FRONTEND=noninteractive
ARG TARGETPLATFORM
ARG TAG

RUN apt-get update && apt-get -y install \
build-essential \
libcliquer1 \
gfortran \
liblapack3 \
libopenblas-dev \
libgsl25 \
libtbb2 \
curl

WORKDIR /tmp
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then curl -Lo SCIPOptSuite.deb https://github.com/scipopt/scip/releases/download/$(echo "v${TAG}" | tr -d '.')/SCIPOptSuite-${TAG}-Linux-debian.deb; fi
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then curl -Lo SCIPOptSuite.deb https://github.com/scipopt/scip/releases/download/$(echo "v${TAG}" | tr -d '.')/SCIPOptSuite-${TAG}-Linux-arm64.deb; fi
RUN dpkg -i SCIPOptSuite.deb && rm SCIPOptSuite.deb

0 comments on commit 6e2e5a6

Please sign in to comment.