Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

io: Update Dockerfile #694

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 34 additions & 10 deletions impls/io/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:xenial
FROM ubuntu:24.04 AS base
MAINTAINER Joel Martin <[email protected]>

##########################################################
Expand All @@ -9,25 +9,49 @@ MAINTAINER Joel Martin <[email protected]>
RUN apt-get -y update

# Required for running tests
RUN apt-get -y install make python
RUN apt-get -y install make python3
RUN ln -fs /usr/bin/python3 /usr/local/bin/python

# Some typical implementation and test requirements
RUN apt-get -y install curl libreadline-dev libedit-dev

RUN apt-get -y install libpcre3-dev

RUN mkdir -p /mal
WORKDIR /mal

##########################################################
# Compile the io interpreter
##########################################################

FROM base AS builder

RUN apt-get -y install git cmake gcc

RUN cd /tmp \
&& git clone --recursive -q --depth=1 https://github.com/IoLanguage/io.git \
&& cd /tmp/io \
&& mkdir build && cd build \
&& cmake -DCMAKE_BUILD_TYPE=release .. && make && make install

# Force eerie (Io package manager) to install itself and the packages in /opt/.eerie
ENV HOME=/opt

RUN cd /tmp/io/eerie \
&& mkdir -p /opt \
&& . ./install_unix.sh --notouch \
&& eerie install https://github.com/IoLanguage/Range.git \
&& eerie install https://github.com/IoLanguage/ReadLine.git \
&& eerie install https://github.com/IoLanguage/Regex.git

##########################################################
# Specific implementation requirements
##########################################################

# Zip
RUN apt-get -y install unzip
FROM base AS io

RUN cd /tmp && curl -O -J -L http://iobin.suspended-chord.info/linux/iobin-linux-x64-deb-current.zip \
&& unzip iobin-linux-x64-deb-current.zip IoLanguage-2013.11.04-Linux-x64.deb \
&& dpkg -i IoLanguage-2013.11.04-Linux-x64.deb \
&& ldconfig \
&& rm -f iobin-linux-x64-deb-current.zip IoLanguage-2013.11.04-Linux-x64.deb
COPY --from=builder /usr/local/lib/ /usr/lib/
COPY --from=builder /usr/local/bin/ /usr/bin/
COPY --from=builder /opt/.eerie/ /opt/.eerie/

ENV HOME /mal
ENV HOME=/mal
11 changes: 9 additions & 2 deletions impls/io/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
all:
@true
STEPS = step0_repl.io step1_read_print.io step2_eval.io step3_env.io step4_if_fn_do.io step5_tco.io \
step6_file.io step7_quote.io step8_macros.io step9_try.io stepA_mal.io

all: eerie

eerie:
ln -s /opt/.eerie eerie

$(STEPS): eerie

clean:
5 changes: 1 addition & 4 deletions impls/io/run
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/bin/bash

# Io prints the line "Registering Regex: Regex" when loading the Regex module
# for the first time, and there's no way to suppress it. To avoid polluting
# the Mal script output, we swallow the first 25 bytes.
io $(dirname $0)/${STEP:-stepA_mal}.io "$@" | (read -N 25 -t 10 ; cat)
io $(dirname $0)/${STEP:-stepA_mal}.io "$@"