| 1 | # Custom container image for the WSLC-CustomContainer sample. |
| 2 | # |
| 3 | # A tiny Python tool that turns text (e.g. a URL) into a scannable QR code drawn |
| 4 | # with Unicode block characters, printed straight to the terminal. |
| 5 | # |
| 6 | # This image is built automatically when the C# project is built, via the |
| 7 | # <WslcImage> item in WSLCCustomContainer.csproj (no manual docker/wslc steps). |
| 8 | |
| 9 | FROM python:3.11-slim |
| 10 | |
| 11 | # qrcode renders ASCII/Unicode QR codes with no extra native dependencies. |
| 12 | RUN pip install --no-cache-dir qrcode |
| 13 | |
| 14 | COPY qr.py /app/qr.py |
| 15 | |
| 16 | # No ENTRYPOINT/CMD: the host keeps the container alive with its own init |
| 17 | # process (sleep) and then execs `python /app/qr.py <text>` to render the code. |
| 18 | # (Run it directly with: wslc run customcontainer python /app/qr.py "your text".) |