Skip to content

Commit 5f157c9

Browse files
committed
feat(docker): add Dockerfiles for Befunge interpreter and standalone execution
1 parent 587771f commit 5f157c9

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

images/befunge/Dockerfile.base

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM whanos-foundation
2+
3+
# Install Python (for the Befunge interpreter)
4+
RUN nix-env -iA nixpkgs.python3
5+
6+
# Add our Befunge-93 interpreter to PATH
7+
# Place it in $HOME/.local/bin which is already on PATH in the foundation image
8+
WORKDIR /home/nixuser
9+
# When building, set the build context to the repo root (.) so this path resolves
10+
COPY befunge/befunge93 /home/nixuser/.local/bin/befunge93
11+
# RUN chmod +x /home/nixuser/.local/bin/befunge93
12+
13+
WORKDIR /app
14+
15+
# Default command (can be overridden by custom Dockerfile)
16+
CMD ["/bin/bash"]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM whanos-befunge AS builder
2+
3+
# Use a consistent app working directory
4+
WORKDIR /app
5+
6+
# Copy the Befunge program (expected: single app/main.bf)
7+
COPY app app
8+
9+
# Validate required entry file exists during build
10+
RUN test -f app/main.bf
11+
12+
FROM whanos-befunge
13+
WORKDIR /app
14+
COPY --from=builder /app /app
15+
16+
# Run the interpreter against the provided program
17+
ENTRYPOINT ["befunge93"]
18+
CMD ["app/main.bf"]

0 commit comments

Comments
 (0)