-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
49 lines (37 loc) · 1.38 KB
/
dockerfile
File metadata and controls
49 lines (37 loc) · 1.38 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Use the official Alpine Linux image as the base image
FROM --platform="linux/${TARGETARCH}" alpine:latest as nullforge-anvil
RUN mkdir -p /NullForge/Make && \
mkdir -p /NullForge/tests
# Set the working directory inside the container
WORKDIR /NullForge
# Install necessary dependencies and build tools
RUN apk update && \
apk add --no-cache \
clang \
llvm \
cmd:bash
# Copy the project files into the container
COPY build-make.bash /NullForge/build-makefile.bash
COPY Make/* /NullForge/Make/
COPY tests/* /NullForge/tests/
COPY LICENSE /NullForge/LICENSE
# Build the project using the provided build script
RUN ./build-make.bash
# Make the test runner script executable
RUN chmod +x tests/test_runner.sh
# Run the tests
RUN ./tests/test_runner.sh
# Set the entry point to run the compiled binary
ENTRYPOINT ["./out/usr/bin/make"]
# Stage 2: Create the final image
# shellcheck disable=SC2154
FROM --platform="linux/${TARGETARCH}" scratch AS nullforge-make0
# set inherited values
LABEL version="1.0"
LABEL org.opencontainers.image.title="NullForge-make-0"
LABEL org.opencontainers.image.description="Empty image with stage0 make installed"
LABEL org.opencontainers.image.vendor="individual"
LABEL org.opencontainers.image.licenses="Apache-2.0"
COPY --from=nullforge-anvil /NullForge/out/usr/* /
COPY --from=nullforge-anvil /NullForge/LICENSE /LICENSE
ENTRYPOINT ["/bin/make"]