File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ UBUNTU_TAG = focal-20230801
2+ APSIM_VERSION = 7317
3+ GITHUB_CONTAINER_REPO = ghcr.io/jbris/apsimx-docker:${ APSIM_VERSION }
Original file line number Diff line number Diff line change 1+ ARG UBUNTU_TAG
2+
3+ FROM ubuntu:${UBUNTU_TAG}
4+
5+ ENV DEBIAN_FRONTEND=noninteractive
6+
7+ ARG APSIM_VERSION
8+
9+ RUN apt-get update \
10+ && apt-get install -y --no-install-recommends libsqlite3-dev tzdata curl ca-certificates build-essential
11+
12+ RUN ln -fs /usr/share/zoneinfo/Pacific/Auckland /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
13+
14+ RUN curl -o /tmp/packages-microsoft-prod.deb https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb
15+
16+ RUN curl -o /tmp/ApsimSetup.deb https://builds.apsim.info/api/nextgen/download/$APSIM_VERSION/Linux
17+
18+ RUN apt-get update \
19+ && apt -y install /tmp/packages-microsoft-prod.deb \
20+ && apt-get update \
21+ && apt-get install -y --no-install-recommends dotnet-runtime-6.0
22+
23+ RUN apt-get update \
24+ && apt -y install --no-install-recommends /tmp/ApsimSetup.deb \
25+ && chmod +x /usr/local/bin/*
26+
27+ RUN rm -rf /tmp/ApsimSetup.deb /tmp/packages-microsoft-prod.deb \
28+ && apt-get clean \
29+ && rm -rf /var/lib/apt/lists/* \
30+ && rm -rf /tmp/downloaded_packages \
31+ && apt-get -y autoremove --purge
Original file line number Diff line number Diff line change 1+ version : " 3.9"
2+
3+ services :
4+
5+ apsimx :
6+ image : ubuntu:${UBUNTU_TAG}
7+ build :
8+ args :
9+ UBUNTU_TAG : $UBUNTU_TAG
10+ APSIM_VERSION : $APSIM_VERSION
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ . .env
4+
5+ docker compose pull
6+ docker compose build
7+
8+ echo $CR_PAT | docker login ghcr.io -u USERNAME --password-stdin
9+
10+ DOCKER_IMAGE_HASH=$( docker images --format " {{.ID}} {{.CreatedAt}}" | sort -rk 2 | awk ' NR==1{print $1}' )
11+ docker tag " $DOCKER_IMAGE_HASH " " $GITHUB_CONTAINER_REPO "
12+ docker push " $GITHUB_CONTAINER_REPO "
You can’t perform that action at this time.
0 commit comments