Skip to content

Commit

Permalink
Use asdf when building for ubuntu 20.04
Browse files Browse the repository at this point in the history
  • Loading branch information
marteinn committed Feb 13, 2024
1 parent ead62ac commit a7c57e0
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 20 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/publish_elixir-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
matrix:
docker-image:
- elixir-ubuntu-22-04
#- elixir-ubuntu-16-04
#- elixir-ubuntu-18-04
#- elixir-ubuntu-20-04
- elixir-ubuntu-20-04
#- elixir-ubuntu-16-04
#- elixir-ubuntu-18-04
steps:
- uses: actions/checkout@v2
- name: Log in to GitHub Container Registry
Expand Down
31 changes: 23 additions & 8 deletions elixir-ubuntu-20-04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,36 @@ FROM ubuntu:20.04
MAINTAINER Fröjd

ARG DEBIAN_FRONTEND=noninteractive

ARG ERLANG_VERSION
ENV ERLANG_VERSION ${ERLANG_VERSION:-25.3}

ARG ELIXIR_VERSION
ENV ELIXIR_VERSION ${ELIXIR_VERSION:-1.10.3-1}
ENV ELIXIR_VERSION ${ELIXIR_VERSION:-1.15.7-otp-25}

RUN apt-get update && apt-get -y install wget sudo gnupg \
&& apt-get -y install git ssh ca-certificates locales \
&& wget https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb \
&& dpkg -i erlang-solutions_2.0_all.deb
RUN apt-get update -y && apt-get install -y \
curl \
git \
unzip \
locales

# Ensure that we always use UTF-8 and with en_US locale
RUN locale-gen en_US.UTF-8
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'

RUN apt-get update \
&& apt-get -y install esl-erlang elixir=$ELIXIR_VERSION \
&& rm -rf /var/lib/apt/lists/*
# Install asdf
RUN git clone --depth 1 https://github.com/asdf-vm/asdf.git ~/.asdf
ENV PATH="$PATH:/root/.asdf/bin"
ENV PATH="$PATH:/root/.asdf/bin"
ENV PATH=$PATH:/root/.asdf/shims

RUN asdf plugin-add erlang https://github.com/michallepicki/asdf-erlang-prebuilt-ubuntu-20.04.git
RUN asdf install erlang $ERLANG_VERSION
RUN asdf global erlang $ERLANG_VERSION

RUN asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
RUN asdf install elixir $ELIXIR_VERSION
RUN asdf global elixir $ELIXIR_VERSION

RUN mix local.hex --force && mix local.rebar --force

Expand Down
30 changes: 21 additions & 9 deletions elixir-ubuntu-20-04/Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,36 @@
NAME = ghcr.io/frojd/dockerimages/elixir-ubuntu-20-04

build:
docker build -t $(NAME):1.13.0 --rm --build-arg ELIXIR_VERSION=1.13.0-1 .
docker build -t $(NAME):1.12.2 --rm --build-arg ELIXIR_VERSION=1.12.2-1 .
docker build -t $(NAME):1.11.4 --rm --build-arg ELIXIR_VERSION=1.11.4-1 .
docker build -t $(NAME):1.10.4 --rm --build-arg ELIXIR_VERSION=1.10.4-1 .
docker build -t $(NAME):1.16.1 --rm --platform linux/x86_64 --build-arg ERLANG_VERSION=26.2 --build-arg ELIXIR_VERSION=1.16.1-otp-26 .
docker build -t $(NAME):1.15.7 --rm --platform linux/x86_64 --build-arg ERLANG_VERSION=26.2 --build-arg ELIXIR_VERSION=1.15.7-otp-26 .
docker build -t $(NAME):1.14.5 --rm --platform linux/x86_64 --build-arg ERLANG_VERSION=26.2 --build-arg ELIXIR_VERSION=1.14.5-otp-26 .
docker build -t $(NAME):1.13.4 --rm --platform linux/x86_64 --build-arg ERLANG_VERSION=25.3 --build-arg ELIXIR_VERSION=1.13.4-otp-25 .
docker build -t $(NAME):1.12.3 --rm --platform linux/x86_64 --build-arg ERLANG_VERSION=24.3 --build-arg ELIXIR_VERSION=1.12.3-otp-24 .
docker build -t $(NAME):1.11.4 --rm --platform linux/x86_64 --build-arg ERLANG_VERSION=24.3 --build-arg ELIXIR_VERSION=1.11.4-otp-24 .
docker build -t $(NAME):1.10.4 --rm --platform linux/x86_64 --build-arg ERLANG_VERSION=23.3 --build-arg ELIXIR_VERSION=1.10.4-otp-23 .

docker tag $(NAME):1.13.0 $(NAME):1.13
docker tag $(NAME):1.12.2 $(NAME):1.12
docker tag $(NAME):1.16.1 $(NAME):1.16
docker tag $(NAME):1.15.7 $(NAME):1.13
docker tag $(NAME):1.14.5 $(NAME):1.14
docker tag $(NAME):1.13.4 $(NAME):1.13
docker tag $(NAME):1.12.3 $(NAME):1.12
docker tag $(NAME):1.11.4 $(NAME):1.11
docker tag $(NAME):1.10.4 $(NAME):1.10
docker tag $(NAME):1.13 $(NAME):latest
docker tag $(NAME):1.16 $(NAME):latest

push:
docker push $(NAME):1.10
docker push $(NAME):1.10.4
docker push $(NAME):1.11
docker push $(NAME):1.11.4
docker push $(NAME):1.12
docker push $(NAME):1.12.2
docker push $(NAME):1.12.3
docker push $(NAME):1.13
docker push $(NAME):1.13.0
docker push $(NAME):1.13.4
docker push $(NAME):1.14
docker push $(NAME):1.14.5
docker push $(NAME):1.15
docker push $(NAME):1.15.7
docker push $(NAME):1.16
docker push $(NAME):1.16.1
docker push $(NAME):latest

0 comments on commit a7c57e0

Please sign in to comment.