|
| 1 | +# Copyright 2026 Katteli Inc. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +# The testflows/machine-examples image: every program, static, at |
| 16 | +# /examples/<name>. A machine is x86_64, so the image is linux/amd64 only. |
| 17 | +FROM --platform=linux/amd64 debian:bookworm-slim AS build |
| 18 | +RUN apt-get update \ |
| 19 | + && apt-get install -y --no-install-recommends gcc libc6-dev make file \ |
| 20 | + && rm -rf /var/lib/apt/lists/* |
| 21 | +WORKDIR /src |
| 22 | +COPY Makefile ./ |
| 23 | +COPY hello hello |
| 24 | +COPY races races |
| 25 | +COPY starvation starvation |
| 26 | +COPY stress stress |
| 27 | +RUN make check |
| 28 | + |
| 29 | +# Nothing but the programs: they are static, so they need no libraries, and |
| 30 | +# a disk built from this image carries only what it runs. |
| 31 | +FROM scratch |
| 32 | +ARG VERSION=dev |
| 33 | +LABEL org.opencontainers.image.title="TestFlows Machine examples" \ |
| 34 | + org.opencontainers.image.description="Programs to run on TestFlows Machine" \ |
| 35 | + org.opencontainers.image.url="https://testflows.com/machine/" \ |
| 36 | + org.opencontainers.image.source="https://github.com/testflows/Machine-Examples" \ |
| 37 | + org.opencontainers.image.licenses="Apache-2.0" \ |
| 38 | + org.opencontainers.image.vendor="Katteli Inc." \ |
| 39 | + org.opencontainers.image.version="${VERSION}" |
| 40 | +COPY --from=build /src/bin/ /examples/ |
| 41 | +COPY LICENSE /LICENSE |
| 42 | +ENTRYPOINT ["/examples/hello-world"] |
0 commit comments