forked from PLC-lang/rusty
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (21 loc) · 722 Bytes
/
Dockerfile
File metadata and controls
26 lines (21 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
FROM ghcr.io/plc-lang/rust-llvm:latest
# Allow invoking `plc` from anywhere
ENV PLCLOC="/opt/rusty"
ENV STDLIBLOC="/opt/rusty/stdlib"
ENV PATH="${PLCLOC}:${PATH}"
# Give all users access to cargo and rust home
RUN chmod -R a+rw $CARGO_HOME \
&& chmod -R a+rw $RUSTUP_HOME
# Required if we want to use `lld` as the default linker for RuSTy
ENV LLVM_VER=14
RUN ln -sf /usr/bin/ld.lld-$LLVM_VER /usr/bin/ld.lld
# Install the local RuSTy version
WORKDIR /rusty
COPY . .
RUN ./scripts/build.sh --build --release --package
RUN mkdir -p ${PLCLOC} && \
cp /rusty/target/release/plc ${PLCLOC}
RUN mkdir -p ${STDLIBLOC} && \
cp -r /rusty/output/* ${STDLIBLOC}
ENTRYPOINT [ "/bin/bash", "-c" ]
CMD ["plc", "--help"]