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

Support for toolchain docker image #20

Merged
merged 6 commits into from
Apr 21, 2023
Merged

Support for toolchain docker image #20

merged 6 commits into from
Apr 21, 2023

Conversation

ziopio
Copy link
Member

@ziopio ziopio commented Apr 14, 2023

Why?
With this we have a parachute in case toolchain compilation is broken and some random user needs to be able to build OTP for him/her-self.

This feature requires the docker engine to be up and running.

It expects a docker image tagged grisp2-rtems-toolchain to be available.
The image must contain a built toolchain under /grisp2-rtems-toolchain/rtems/5 and have GRISP_TC_ROOT and PATH environment variables set accordingly.

The idea here is to use docker just to run toolchain related commands and leave all other stuff to the host erlang and rebar3 installations. That said, this feature needs to mount the project directory as a docker volume inside the container.

To make stuff more simple, the mounted volume has (in the container) the same identical path of the working dir on the host. This will be a problem if we run in a Windows file system.

Here the experimental dockerfile, the image is 6.48 GB and can certainly be lighter although the toolchain alone is pretty big.

FROM ubuntu:latest

RUN set -xe \
    && apt-get update \
    && baseDeps='ca-certificates git unzip' \
    && apt-get install -y --no-install-recommends $baseDeps \
    && toolchainDeps='build-essential flex bison cmake texinfo device-tree-compiler u-boot-tools lzop libusb-1.0-0-dev python3 python-is-python3 libpython3-dev python3-dev' \
    && apt-get install -y --no-install-recommends $toolchainDeps

RUN git clone https://github.com/grisp/grisp2-rtems-toolchain

WORKDIR /grisp2-rtems-toolchain

RUN  make install

WORKDIR /

RUN set -xe \
    && apt purge -y --auto-remove $toolchainDeps \
    && apt purge -y --auto-remove $baseDeps

ENV GRISP_TC_ROOT /grisp2-rtems-toolchain/rtems/5
ENV PATH $GRISP_TC_ROOT/bin:$PATH

@ziopio ziopio requested a review from peerst April 20, 2023 10:08
@ziopio ziopio merged commit bce5d39 into master Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants