Commit 4a1e2ae5 authored by Vladimír Štill's avatar Vladimír Štill
Browse files

Split docker images, use FI registry

parent 0599d5d6
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+2 −0
Original line number Diff line number Diff line
_stamps/
local.make
+29 −16
Original line number Diff line number Diff line
FROM docker.io/debian:buster-20210721
FROM docker.io/debian:bullseye-20220711 as base

# The following originates from the 'haskell-8.6.5' Dockerfile
ENV LANG            C.UTF-8
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        gnupg ca-certificates dirmngr curl git apt-utils \
        zlib1g-dev libtinfo-dev libsqlite3-dev g++ netbase xz-utils make locales wget

RUN echo 'deb http://downloads.haskell.org/debian buster main' > /etc/apt/sources.list.d/ghc.list && \
    apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA3CBA3FFE22B574 && \
    apt-get update
RUN apt-get install -y --no-install-recommends \
          ghc-8.4.4 ghc-8.6.5 ghc-8.8.4 ghc-8.10.4 ghc-9.0.1 cabal-install-3.4
ENV PATH /root/.cabal/bin:/root/.local/bin:/opt/cabal/3.4/bin:/opt/ghc/9.0.1/bin:/opt/ghc/8.10.4/bin:$PATH:/opt/ghc/8.8.4/bin:/opt/ghc/8.6.5/bin:/opt/ghc/8.4.4/bin
RUN ghc --version && ghci --version
        zlib1g-dev libtinfo-dev libsqlite3-dev netbase xz-utils make locales wget \
        python-is-python3

RUN echo "Europe/Prague" > /etc/timezone && \
    unlink /etc/localtime && \
@@ -28,6 +21,10 @@ RUN echo "Europe/Prague" > /etc/timezone && \

ENV LANG en_US.UTF-8


###############################################################################
from base as texlive

# New TeX Live
COPY texlive.profile /root/texlive.profile
RUN cd /root && \
@@ -41,6 +38,27 @@ ENV MANPATH /opt/texlive/texmf-dist/doc/man:$MANPATH
ENV INFOPATH /opt/texlive/texmf-dist/doc/info:$INFOPATH
RUN pdflatex --version && lualatex --version && context --version && latexmk --version

###############################################################################
from base as haskell-base

# g++
RUN echo 'deb http://downloads.haskell.org/debian bullseye main' > /etc/apt/sources.list.d/ghc.list && \
    apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA3CBA3FFE22B574
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
          ghc-8.4.4 ghc-8.6.5 ghc-8.8.4 ghc-8.10.4 ghc-9.0.1 cabal-install-3.6
ENV PATH /root/.cabal/bin:/root/.local/bin:/opt/cabal/3.4/bin:/opt/ghc/9.0.1/bin:/opt/ghc/8.10.4/bin:$PATH:/opt/ghc/8.8.4/bin:/opt/ghc/8.6.5/bin:/opt/ghc/8.4.4/bin
RUN ghc --version && ghci --version

from haskell-base as haskell-ib015

# here we also need TeXLive
COPY --from texlive /opt/texlive
ENV PATH /opt/texlive/bin/x86_64-linux:$PATH
ENV MANPATH /opt/texlive/texmf-dist/doc/man:$MANPATH
ENV INFOPATH /opt/texlive/texmf-dist/doc/info:$INFOPATH
RUN pdflatex --version && lualatex --version && context --version && latexmk --version

# install dependencies for Haskell study materials
RUN cabal v2-update && cabal v2-install pandoc-2.14
RUN for GHC in ghc-8.4.4 ghc-8.6.5 ghc-8.8.4 ghc-8.10.4 ghc-9.0.1; do cabal v2-install --lib --with-ghc $GHC HUnit QuickCheck deepseq random printf-mauke aeson data-default-class text; done
@@ -57,10 +75,5 @@ RUN apt-get update && \
RUN pip3 install flake8 pylint pycodestyle mypy mypy-extensions pytest hypothesis
RUN pytest --version && mypy --version && flake8 --version

# for the sake of minted and other stupid programs that expect python to exist
# needed on bullseye and newer
# RUN ln -s /usr/bin/python3 /usr/bin/python
RUN ls -l /usr/bin/python


CMD ["bash"]
+24 −3
Original line number Diff line number Diff line
DOCKER   = docker
IMAGE   = haskell-ib015
TAG     = v2021.0.0
IMAGES   = base haskell-base texlive haskell-ib015
TAG      = v2022.0.0
REGISTRY = gitlab.fi.muni.cz:5050
PROJECT  = xstill/ci-images
USERNAME != whoami

-include local.make

all: Dockerfile
	$(DOCKER) build $(DOCKEROPTS) -t '$(IMAGE):$(TAG)' .
	$(DOCKER) tag '$(IMAGE):$(TAG)' '$(IMAGE):latest'

push : $(IMAGES:%=_stamps/push.%)

$(IMAGES) : % : _stamps/build.%

login :
	$(DOCKER) login $(REGISTRY) || $(DOCKER) login --username $(USERNAME) $(REGISTRY)

_stamps/build.% : Dockerfile
	mkdir -p _stamps
	$(DOCKER) build --tag $(@:_stamps/build.%=%):$(TAG) --target $(@:_stamps/build.%=%) .
	touch $@

_stamps/push.% : _stamps/build.% login
	$(DOCKER) push $(@:_stamps/push.%=%):$(TAG)  $(REGISTRY)/$(PROJECT)/$(@:_stamps/push.%=%):$(TAG)
	touch $@

.PHONY: push all login $(IMAGES)