I am attempting to wrap a Raku based web app in a dockerfile. I am using the Cro web framework but I cannot seem to install the Cro successfully.
I tried the dockerfile below:
# Use the official Rakudo Star image
FROM rakudo-star:latest
RUN apt update && \
apt upgrade -y && \
apt install zip -y && \
apt install build-essential -y && \
rm -rf /var/lib/apt/lists/*
# Set the working directory inside the container
WORKDIR /app
# Copy your project files into the container
COPY ./bin /app/bin
COPY ./config /app/config
COPY ./lib /app/lib
COPY ./t /app/t
COPY ./META6.json /app
COPY ./www /app/www
RUN zef upgrade zef
# install dependencies not in raku.land
RUN git clone https://github.com/JuneKelly/perl6-config-clever && \
cd perl6-config-clever && \
zef install .
RUN git clone https://github.com/skinkade/crypt-random && \
cd crypt-random && \
zef install .
# Install project dependencies
RUN zef install --verbose --force --/test Array::Circular
RUN zef install --verbose --force --/test Docker::File
RUN zef install --verbose --force --/test File::Ignore
RUN zef install --verbose --force --/test IO::Socket::Async::SSL
RUN zef install --verbose --force --/test Digest::SHA1::Native
RUN zef install --debug --/test cro
RUN zef install --verbose --force --/test --deps-only .
# Expose any necessary ports (optional)
# EXPOSE 8080
# Set the default command to run your Raku application
CMD ["raku", "/app/bin/app"]
I am expecting it to build, but I get errors like below:
> [18/20] RUN zef install --verbose --force --/test Cro::HTTP:
2.966 ===> Searching for: Cro::HTTP
37.74 Use of uninitialized value of type IO::Path in string context.
37.74 Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
82.97 Use of uninitialized value of type IO::Path in string context.
82.97 Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
82.97 Use of uninitialized value of type IO::Path in string context.
82.97 Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
82.97 Use of uninitialized value of type IO::Path in string context.
82.97 Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
82.97 in block at /usr/share/perl6/site/sources/CD3A622C2C09A8A47FE369BE7FE1F5CB7001C1B1 (Zef::Client) line 563
82.97 in block at /usr/share/perl6/site/sources/CD3A622C2C09A8A47FE369BE7FE1F5CB7001C1B1 (Zef::Client) line 563
82.97 in block at /usr/share/perl6/site/sources/CD3A622C2C09A8A47FE369BE7FE1F5CB7001C1B1 (Zef::Client) line 563
82.97 in block at /usr/share/perl6/site/sources/CD3A622C2C09A8A47FE369BE7FE1F5CB7001C1B1 (Zef::Client) line 563
82.97 Use of uninitialized value of type IO::Path in string context.
82.97 Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
<SNIPPED>
Dockerfile:38
--------------------
36 | RUN zef install --verbose --force --/test IO::Socket::Async::SSL
37 | RUN zef install --verbose --force --/test Digest::SHA1::Native
38 | >>> RUN zef install --verbose --force --/test Cro::HTTP
39 | RUN zef install --debug --/test cro
40 | RUN zef install --verbose --force --/test --deps-only .
--------------------
ERROR: failed to solve: process "/bin/sh -c zef install --verbose --force --/test Cro::HTTP" did not complete successfully: exit code: 1
Any ideas? As you can see I have already been trying a few hacks :(