Skip to content

Commit

Permalink
Merge branch 'docker' into 'master'
Browse files Browse the repository at this point in the history
Create public Docker image for SCIPOptSuite

See merge request integer/scip!3235
  • Loading branch information
mmghannam committed Nov 10, 2023
2 parents 0379560 + 6e2e5a6 commit 8132359
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 8132359

Please sign in to comment.