Skip to content

Commit

Permalink
let's start with a SLiM container
Browse files Browse the repository at this point in the history
  • Loading branch information
lkirk committed May 21, 2024
0 parents commit 1a470cf
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: docker publish

on: push

jobs:
build-tools-images:
runs-on: ubuntu-latest
strategy:
matrix:
container:
- name: SLiM
version: 4.2.2
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata for Docker
id: metadata # store tags/labels in this workflow id
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}/tools/${{ matrix.container.name }}
tags: |
type=raw,version=${{ matrix.container.version }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: docker/tools/${{ matrix.container.name }}
load: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
43 changes: 43 additions & 0 deletions docker/tools/SLiM/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM debian:trixie-slim AS base
FROM base AS build-stage

ARG SLIM_VERSION
ARG MAKE_THREADS=6

RUN \
set -ex; \
apt-get update; \
apt-get install -y --no-install-recommends \
curl \
ca-certificates \
cmake \
make \
gcc \
g++ \
; \
rm -rf /var/lib/apt/lists/*

RUN \
set -exu; \
curl -L "https://github.com/MesserLab/SLiM/archive/refs/tags/v${SLIM_VERSION}.tar.gz" | tar -xz; \
cd "SLiM-${SLIM_VERSION}"; \
mkdir build; \
cd build; \
cmake -DBUILD_LTO=ON -DBUILD_TYPE=Release ..; \
make -j "$MAKE_THREADS"; \
mv slim /usr/local/bin

FROM base AS final

COPY --from=build-stage /usr/local/bin /usr/local/bin

# RUN \
# set -ex; \
# apt-get update; \
# apt-get install -y --no-install-recommends \
# libcurl4 \
# libgsl27 \
# libperl5.34; \
# rm -rf /var/lib/apt/lists/*

ENTRYPOINT ["slim"]

0 comments on commit 1a470cf

Please sign in to comment.