Skip to content

Fix infinite recursion in Docker entrypoint script - #22

Closed
skunklabz with Copilot wants to merge 5 commits into
mainfrom
copilot/fix-docker-entrypoint-script
Closed

skunklabz with Copilot wants to merge 5 commits into
mainfrom
copilot/fix-docker-entrypoint-script

Conversation

Copilot AI commented Dec 19, 2025 •

Copy link
Copy Markdown
Contributor

The config/mvs.fixed script called exec ./mvs, but the Dockerfile copies mvs.fixed to mvs, creating infinite recursion. Container startup flooded console with messages without launching Hercules.

Changes

  • Direct Hercules invocation: Replace recursive ./mvs call with ./hercules/linux/64/bin/hercules -f "${CONFIG_FILE}"
  • Config file detection: Check both ./conf/tk4-.cnf and ./tk4-.cnf to handle variations in TK4- distribution layout
  • Error messages: Show attempted paths when config file not found
# Before (infinite loop)
exec ./mvs

# After (direct invocation)
exec ./hercules/linux/64/bin/hercules -f "${CONFIG_FILE}"

The script now starts Hercules directly instead of calling itself recursively.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • wotho.pebble-beach.ch
    • Triggering command: /usr/bin/wget wget --no-check-certificate -O tk4-_v1.00_current.zip REDACTED (dns block)
    • Triggering command: /usr/bin/wget wget --no-check-certificate -O tk4-_v1.00_current.zip REDACTED y.pem (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[BUG]</issue_title>
<issue_description>## Bug Description
Current Docker image (tk4-latest) entrypoint script does nothing but calling itself (infinite loop).

Steps to Reproduce

docker run --rm \
  --name tk4-hercules \
  -p 3270:3270 \
  -p 8038:8038 \
  ghcr.io/skunklabz/tk4-hercules:latest

observe your shell being flooded before CTRL-C ing 😉

Expected Behavior

When starting the container, it should spin up the hercules emulator and the tk system.

Actual Behavior

The script results in an infinite loop printing some context information and never doing anything.

Environment

-Docker Image: sha256:645a3806607a9e88bee282184950bea747fcafccc018cdf128c18bfc66cafdec

  • OS: Mac OS X Sequoia 15.2 on Apple M2 (ARM64)
  • Docker Version: 28.51

Additional Context

It looks like the entrypoint script mvs residing in the image root at /tk4-/ is broken. When looking at it, one may examine that the only thing it does is printing out:

=== TK4- MVS Startup ===
Current directory: /tk4-
Architecture: aarch64
Starting MVS with TK4- configuration...

before calling itself (see: https://github.com/skunklabz/tk4-hercules/blob/main/config/mvs.fixed#L37).

I have to say that I really much like the idea of this repository, also containing a lot of useful learning resources for mainframe demonstration purposes. However, there seems to be a lot of vibe-coded content as well, thus I am a bit worried about stability.

Checklist

  • I have searched existing issues to avoid duplicates
  • I have provided all requested information
  • I can reproduce this issue consistently </issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits December 19, 2025 04:02
Co-authored-by: skunklabz <13306474+skunklabz@users.noreply.github.com>
Co-authored-by: skunklabz <13306474+skunklabz@users.noreply.github.com>
Co-authored-by: skunklabz <13306474+skunklabz@users.noreply.github.com>
Co-authored-by: skunklabz <13306474+skunklabz@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix entrypoint script for Docker image tk4-latest Fix infinite recursion in Docker entrypoint script Dec 19, 2025
Copilot AI requested a review from skunklabz December 19, 2025 04:07
@skunklabz
skunklabz marked this pull request as ready for review December 19, 2025 04:08
@skunklabz skunklabz closed this Dec 19, 2025
@skunklabz
skunklabz deleted the copilot/fix-docker-entrypoint-script branch January 9, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]

2 participants