container: Fix kcl runtime
As it turns out, KCL literally *compiles* a program from the KCL sources. The program it creates needs to link with its runtime library, `libkclvm_cli_cdylib.so`. The `kcl` command extracts this library, along with a helper utility `kclvm_cli`, which performs the actual compilation and linking. In a container, `/root/go` is probably mounted read-only, so we need to extract these files ahead of time and put them in another location, so the `kcl` command does not have to do it each time it runs.master
parent
d44e7df8cf
commit
79de375b30
|
@ -10,7 +10,8 @@ RUN --mount=type=cache,target=/var/cache \
|
||||||
|
|
||||||
RUN --mount=type=cache,target=/root/go \
|
RUN --mount=type=cache,target=/root/go \
|
||||||
go install kcl-lang.io/cli/cmd/kcl@v0.7 \
|
go install kcl-lang.io/cli/cmd/kcl@v0.7 \
|
||||||
&& cp /root/go/bin/kcl /usr/local/bin \
|
&& /root/go/bin/kcl > /dev/null \
|
||||||
|
&& cp /root/go/bin/* /usr/local/bin/ \
|
||||||
&& :
|
&& :
|
||||||
|
|
||||||
RUN --mount=type=cache,target=/root/.cargo \
|
RUN --mount=type=cache,target=/root/.cargo \
|
||||||
|
@ -26,6 +27,7 @@ RUN --mount=type=cache,target=/var/cache \
|
||||||
microdnf install -y \
|
microdnf install -y \
|
||||||
--setopt install_weak_deps=0 \
|
--setopt install_weak_deps=0 \
|
||||||
age \
|
age \
|
||||||
|
gcc \
|
||||||
git \
|
git \
|
||||||
&& cp -a /build/usr/local/bin/. /usr/local/bin \
|
&& cp -a /build/usr/local/bin/. /usr/local/bin \
|
||||||
&& for cmd in \
|
&& for cmd in \
|
||||||
|
@ -40,5 +42,9 @@ COPY config.sh /
|
||||||
|
|
||||||
CMD ["/config.sh"]
|
CMD ["/config.sh"]
|
||||||
|
|
||||||
|
ENV KCL_GO_DISABLE_ARTIFACT=on
|
||||||
|
ENV KCL_PKG_PATH=/tmp
|
||||||
|
ENV KCL_CACHE_PATH=/tmp
|
||||||
|
|
||||||
LABEL license= \
|
LABEL license= \
|
||||||
vendor='Dustin C. Hatch' \
|
vendor='Dustin C. Hatch' \
|
||||||
|
|
Loading…
Reference in New Issue