Skip to content

Commit

Permalink
Merge pull request #65 from pprzetacznik/fix/docker_build_1.14
Browse files Browse the repository at this point in the history
chore: Bump otp and iex in Dockerfile requirements
  • Loading branch information
pprzetacznik authored Mar 22, 2024
2 parents b8f15f8 + b54527e commit 92fe5e8
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 19 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,22 @@ name: IElixir Docker
on:
push:
branches: master
pull_request:
branches:
- 'master'
- 'feature/**'
- 'fix/**'

jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Checkout IElixir project
uses: actions/checkout@v2
- name: Generate version
id: gen_ielixir_version
run: |
echo "IELIXIR_VERSION=$(cat ./VERSION).$(date '+%Y%m%d%H%M%S')" >> "$GITHUB_OUTPUT"
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
Expand All @@ -23,16 +34,18 @@ jobs:
with:
push: true
file: ./docker/ielixir-requirements/Dockerfile
tags: pprzetacznik/ielixir-requirements:latest
tags: pprzetacznik/ielixir-requirements:${{ steps.gen_ielixir_version.outputs.IELIXIR_VERSION }}
build-args: |
ERL_VERSION=23.1.2
ELIXIR_VERSION=1.11.2
ERL_VERSION=26.2.3
ELIXIR_VERSION=1.14.2
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
file: ./docker/ielixir/Dockerfile
tags: pprzetacznik/ielixir:latest
tags: pprzetacznik/ielixir:${{ steps.gen_ielixir_version.outputs.IELIXIR_VERSION }}
build-args: |
IELIXIR_REQUIREMENTS_DOCKER_VERSION=${{ steps.gen_ielixir_version.outputs.IELIXIR_VERSION }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
4 changes: 3 additions & 1 deletion .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
branches:
- 'master'
- 'feature/**'
- 'fix/**'

jobs:
build:
Expand All @@ -19,7 +20,8 @@ jobs:
otp-version: ['26']
python-version: ['3.8', '3.12']
steps:
- uses: actions/checkout@v2
- name: Checkout IElixir project
uses: actions/checkout@v2
- name: Install prerequisites
run: |
sudo apt install -y openssl libncurses5
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ If you would like to make some changes to the images you can find dockerfiles in
* docker/ielixir - for dockerfile source of pprzetacznik/ielixir image,
* docker/ielixir-requirements - for dockerfile source of pprzetacznik/ielixir-requirements image.

Elixir builds takend from [hex.pm builds.txt](https://repo.hex.pm/builds/elixir/builds.txt).

#### Other docker images worth seeing

* [Dockerfile for smaller image based on alpine](https://github.com/cprieto/docker-jupyter/blob/master/elixir/Dockerfile)
Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0.0
14 changes: 8 additions & 6 deletions docker/ielixir-requirements/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ ENV WORK_DIR=/opt
ENV ERL_TOP=$WORK_DIR/otp \
ELIXIR_TOP=$WORK_DIR/elixir
ENV PATH=$ERL_TOP/target/bin:$ELIXIR_TOP/bin:$PATH \
ERL_VERSION=23.1.2 \
ELIXIR_VERSION=1.11.2
ERL_VERSION_SHORT=26 \
ERL_VERSION=26.2.2 \
ELIXIR_VERSION=1.14.5

RUN set -xe \
&& apt-get update \
Expand All @@ -29,7 +30,7 @@ RUN set -xe \

RUN mkdir -p $WORK_DIR \
&& cd $WORK_DIR \
&& wget https://github.com/erlang/otp/archive/OTP-$ERL_VERSION.zip -O otp.zip \
&& wget https://github.com/erlang/otp/archive/refs/tags/OTP-${ERL_VERSION}.zip -O otp.zip \
&& unzip otp.zip -d $WORK_DIR \
&& mv $WORK_DIR/otp-OTP-$ERL_VERSION $ERL_TOP \
&& rm otp.zip
Expand All @@ -38,9 +39,10 @@ RUN cd $ERL_TOP \
&& ./otp_build autoconf \
&& ./configure --prefix=$ERL_TOP/target \
&& make \
&& make install \
&& cd $WORK_DIR \
&& wget https://github.com/elixir-lang/elixir/releases/download/v$ELIXIR_VERSION/Precompiled.zip -O elixir.zip \
&& make install

RUN cd $WORK_DIR \
&& wget https://builds.hex.pm/builds/elixir/v${ELIXIR_VERSION}-otp-${ERL_VERSION_SHORT}.zip -O elixir.zip \
&& unzip elixir.zip -d $ELIXIR_TOP \
&& rm elixir.zip

Expand Down
12 changes: 7 additions & 5 deletions docker/ielixir/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM pprzetacznik/ielixir-requirements
ARG IELIXIR_REQUIREMENTS_DOCKER_VERSION
FROM pprzetacznik/ielixir-requirements:$IELIXIR_REQUIREMENTS_DOCKER_VERSION

ENV WORK_DIR=/opt

Expand All @@ -9,10 +10,11 @@ RUN apt install -y \
libsqlite3-dev

RUN set -xe \
&& curl -s https://api.github.com/repos/pprzetacznik/IElixir/releases/latest | grep "tarball_url" | sed -n -e 's/.*tarball_url": "\(.*\)".*/\1/p' | xargs -t curl -fSL -o ielixir.tar.gz \
&& mkdir ielixir \
&& tar -zxvf ielixir.tar.gz -C ielixir --strip-components=1 \
&& rm ielixir.tar.gz \
&& curl -L https://github.com/pprzetacznik/IElixir/archive/refs/heads/master.zip -o ielixir.zip \
&& apt install -y unzip \
&& unzip ielixir.zip -d ielixir_tmp \
&& mv ielixir_tmp/IElixir-master ielixir \
&& rm -rf ielixir_tmp \
&& cd ielixir \
&& ls -alh \
&& mix local.hex --force \
Expand Down
10 changes: 7 additions & 3 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
defmodule IElixir.Mixfile do
use Mix.Project

@version "0.9.21"

def project do
[
app: :ielixir,
version: @version,
version: read_version(),
source_url: "https://github.com/pprzetacznik/IElixir",
name: "IElixir",
elixir: ">= 1.14.0",
Expand Down Expand Up @@ -73,4 +71,10 @@ defmodule IElixir.Mixfile do
}
]
end

def read_version() do
"VERSION"
|> File.read!
|> String.trim
end
end

0 comments on commit 92fe5e8

Please sign in to comment.