# Using Chapel Docker Image

**URL:** <https://chapel.discourse.group/t/using-chapel-docker-image/40194>\
**Category:** Users\
**Created:** [January 30, 2025, 11:18pm UTC](https://chapel.discourse.group/t/using-chapel-docker-image/40194 "2025-01-30T23:18:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Iainmon1](https://yyz2.discourse-cdn.com/free1/user_avatar/chapel.discourse.group/iainmon1/32/458_2.png) [@Iainmon1](https://chapel.discourse.group/u/Iainmon1)\
**Post date:** [January 30, 2025, 11:18pm UTC](https://chapel.discourse.group/t/using-chapel-docker-image/40194/1 "2025-01-30T23:18:07Z")

</div>

I am trying to create a CI system using Github Actions for [ChAI](https://github.com/Iainmon/ChAI). It seems like it would be best to use Docker for this. The tests include numerical correspondence with functions in PyTorch. Therefore, the environment needs to have Chapel, as well as a Python + PyTorch installation. What would be the best way to have one Dockerfile that gives me this?

---

<div class="post-metadata">

**Author:** ![annarift](https://yyz2.discourse-cdn.com/free1/user_avatar/chapel.discourse.group/annarift/32/656_2.png) [@annarift](https://chapel.discourse.group/u/annarift)\
**Post date:** [January 31, 2025, 4:39pm UTC](https://chapel.discourse.group/t/using-chapel-docker-image/40194/2 "2025-01-31T16:39:26Z")

</div>

I think the easiest way would be to write a Dockerfile `FROM` `chapel/chapel`, and then add your additional requirements. It comes with `python3` as that's a Chapel dependency, so all you need to add is installing PyTorch with `pip` or however else.

---

<div class="post-metadata">

**Author:** ![mstrout](https://yyz2.discourse-cdn.com/free1/user_avatar/chapel.discourse.group/mstrout/32/114_2.png) [@mstrout](https://chapel.discourse.group/u/mstrout)\
**Post date:** [February 5, 2025, 6:24pm UTC](https://chapel.discourse.group/t/using-chapel-docker-image/40194/3 "2025-02-05T18:24:36Z")

</div>

Hi Iain,

If you are going to use a Docker file I agree with Anna's suggestions.

I just got Chapel working in Gradescope without pulling from Docker. I couldn't do that because it would be too slow to pull the docker container everytime one of the students submits an assignment.

Gradescope uses a base of Ubuntu 22.04. And then I had my bash setup script do the following:

apt install -y /autograder/source/chapel-2.3.0-1.ubuntu22.amd64.deb

See the Linux package managers at [Downloading Chapel](https://chapel-lang.org/download/) to get the .deb file.

Please let us know what works!!

---

<div class="post-metadata">

**Author:** ![Iainmon1](https://yyz2.discourse-cdn.com/free1/user_avatar/chapel.discourse.group/iainmon1/32/458_2.png) [@Iainmon1](https://chapel.discourse.group/u/Iainmon1)\
**Post date:** [February 17, 2025, 3:36am UTC](https://chapel.discourse.group/t/using-chapel-docker-image/40194/4 "2025-02-17T03:36:10Z")

</div>

Hi Michelle,

Thank you for your suggestion, it worked perfectly!

This is what I did:

```dockerfile
FROM ubuntu:22.04

RUN apt update && apt upgrade -y > /dev/null

COPY deb /

RUN (apt install -y ./chapel-2.3.0-1.ubuntu22.arm64.deb > /dev/null) || (apt install -y ./chapel-2.3.0-1.ubuntu22.amd64.deb > /dev/null)

RUN apt install -y python3-pip > /dev/null

RUN pip3 install numpy torch torchvision > /dev/null

COPY lib /lib
COPY examples /examples
COPY test /test

# Run tests
RUN cd test/correspondence && python3 correspondence.py

```

Is there a general form that the chapel release urls take so that I can wget them instead of bundling them in my library?

---

<div class="post-metadata">

**Author:** ![annarift](https://yyz2.discourse-cdn.com/free1/user_avatar/chapel.discourse.group/annarift/32/656_2.png) [@annarift](https://chapel.discourse.group/u/annarift)\
**Post date:** [February 18, 2025, 5:24pm UTC](https://chapel.discourse.group/t/using-chapel-docker-image/40194/5 "2025-02-18T17:24:54Z")

</div>

I believe Michelle was referring to an alternative route if you would like to avoid the use of Docker for performance/bandwidth, as she did in her use case.

If you are okay with using Docker, it would save some complexity to base your image off the existing Chapel image rather than needing to fetch the latest `.deb` and store it somewhere each time you want to build a new image.

Then the equivalent to your above Dockerfile would be:

```Chapel
FROM chapel/chapel:latest

RUN pip3 install numpy torch torchvision > /dev/null

COPY lib /lib
COPY examples /examples
COPY test /test

# Run tests
RUN cd test/correspondence && python3 correspondence.py

```

---

<div class="post-metadata">

**Author:** ![annarift](https://yyz2.discourse-cdn.com/free1/user_avatar/chapel.discourse.group/annarift/32/656_2.png) [@annarift](https://chapel.discourse.group/u/annarift)\
**Post date:** [February 18, 2025, 5:27pm UTC](https://chapel.discourse.group/t/using-chapel-docker-image/40194/6 "2025-02-18T17:27:08Z")

</div>

To answer your direct question, the Chapel release artifacts have more predictable links found on the Github release pages, see for example [Release Chapel 2.3.0 Release (Winter 2024) · chapel-lang/chapel · GitHub](https://github.com/chapel-lang/chapel/releases/tag/2.3.0); the one you were using is at [https://github.com/chapel-lang/chapel/releases/download/2.3.0/chapel-2.3.0-1.ubuntu22.arm64.deb](https://github.com/chapel-lang/chapel/releases/download/2.3.0/chapel-2.3.0-1.ubuntu22.arm64.deb).
