Skip to content

Commit bb79683

Browse files
committed
Build Hercules from source to pick up fix for SDL Hyperion issue 782.
1 parent 1fd582f commit bb79683

7 files changed

Lines changed: 94 additions & 29 deletions

File tree

Dockerfile

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,49 @@
11
# Dockerfile for the VM/370 Container
2-
FROM ubuntu:latest
2+
# Build the things the final image will need
3+
FROM ubuntu:latest
34

4-
RUN apt-get update
5+
RUN apt-get update
56
RUN apt-get install --no-install-recommends -y unzip wget netcat-traditional ca-certificates
6-
RUN apt-get install --no-install-recommends -y hercules dos2unix regina-rexx
7+
RUN apt-get install --no-install-recommends -y dos2unix regina-rexx
78
RUN apt-get install --no-install-recommends -y python3 python-is-python3
89

10+
# Build Hercules 3.x
11+
RUN <<EOF
12+
set -x
13+
# Hercules Spinhawk 3.x dependencies:
14+
apt-get install -y autoconf automake build-essential gawk git m4 libbz2-dev zlib1g-dev
15+
16+
mkdir -p ~/build_herc
17+
cd ~/build_herc
18+
### TEMP >>>
19+
git clone https://github.com/RossPatterson/spinhawk.git
20+
cd spinhawk
21+
git switch h_0782
22+
### This is what we should normally do instead of the above:
23+
# git https://github.com/rbowler/spinhawk.git
24+
# cd spinhawk
25+
### <<< TEMP
26+
./util/bldlvlck
27+
chmod a+x autogen.sh
28+
./autogen.sh
29+
./configure --prefix=/usr/local/hercules
30+
make
31+
make check
32+
make install
33+
cd
34+
rm -rf ~/build_herc
35+
mkdir -p /opt/hercules/vm370
36+
echo "export PATH=\"/usr/local/hercules/bin:\$PATH\"" > /opt/hercules/vm370/setup.sh
37+
echo "export LD_LIBRARY_PATH=\"/usr/local/hercules/lib:\$LD_LIBRARY_PATH\"" >> /opt/hercules/vm370/setup.sh
38+
EOF
39+
940
WORKDIR /opt/hercules/vm370
1041

1142
# Local Config files
1243
COPY *.sh hercules.conf cleandisks.conf ./
1344
RUN dos2unix *.sh hercules.conf cleandisks.conf
1445
RUN chmod +x *.sh && \
15-
chmod -x hercules.conf cleandisks.conf
46+
chmod -x hercules.conf cleandisks.conf
1647

1748
# DASD
1849
COPY disks/ ./disks/
@@ -29,8 +60,8 @@ RUN rm cleandisks.conf
2960
# Create the final Docker Image
3061
FROM ubuntu:latest
3162

32-
RUN apt-get update && \
33-
apt-get install --no-install-recommends -y hercules c3270 zip unzip netcat-traditional \
63+
RUN apt-get update && \
64+
apt-get install --no-install-recommends -y c3270 zip unzip netcat-traditional \
3465
dos2unix regina-rexx wget ca-certificates python3 python-is-python3 && \
3566
apt-get -y purge $(dpkg --get-selections | grep deinstall | sed s/deinstall//g) && \
3667
rm -rf /var/lib/apt/lists/*
@@ -41,6 +72,7 @@ COPY --from=0 /opt/hercules/vm370/* ./
4172

4273
COPY --from=0 /usr/local/bin/herccontrol /usr/local/bin/herccontrol
4374
COPY --from=0 /usr/local/bin/yata /usr/local/bin/yata
75+
COPY --from=0 /usr/local/hercules/ /usr/local/hercules/
4476

4577
EXPOSE 3270 8038 3505
4678
ENTRYPOINT ["/opt/hercules/vm370/start_vm370.sh"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The Docker images are at https://hub.docker.com/repository/docker/rosspatterson/
77
See this repository's release tab for the Dockerfile build source and the VM/370 DASD files.
88

99
# History
10-
- latest -> 1.6.7
10+
- latest -> 1.6.8
1111
- Version 1.6.7 adds Python and switches to the Python version of the herccontrol tool.
1212
- Version 1.6.0 is built from the VM/370 Community Edition v1.1.2 distribution.
1313
- Version 1.5.3 is built from the VM/370 Community Edition v1.1.0 distribution.

build.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,19 @@ set -e
77
# Show the commands
88
set -x
99

10-
# HercControl
10+
# Install HercControl
1111
wget -nv https://raw.githubusercontent.com/RossPatterson/PyHercControl/refs/tags/v1.1.2/PyHercControl/src/herccontrol
1212
chmod +x herccontrol
1313
mv herccontrol /usr/local/bin
1414

15+
# Add Hercules to paths
16+
. /opt/hercules/vm370/setup.sh
17+
18+
1519
# Remove Shadow Files
1620
mkdir -p ./disks/shadows # Hercules won't run sf- if the shadow dir doesn't exist.
1721
hercules -f cleandisks.conf -d >/dev/null 2>/dev/null &
22+
sleep 5 # Let Hercules get the HTTP server started
1823
herccontrol "sf-* force" -w "HHCCD092I"
1924
herccontrol "exit"
2025

@@ -45,7 +50,7 @@ herccontrol "ipl 6a1" -w "USER DSC LOGOFF AS AUTOLOG1"
4550

4651
# LOGON MAINTC AND READ TAPE
4752
herccontrol "/cp disc" -w "^VM/370 Online"
48-
herccontrol "/logon maintc maintc" -w "^VM Community Edition V1 R1.2"
53+
herccontrol "/logon maintc maintc" -w "^VM Community Edition"
4954
herccontrol "/access (noprof" -w "^Ready;"
5055
herccontrol "/profile" -w "^Ready;"
5156
herccontrol "devinit 480 io/yatabin.aws" -w "^HHCPN098I"
@@ -61,13 +66,13 @@ herccontrol "/yata -v" -w "^Ready;"
6166
herccontrol "/logoff" -w "^VM/370 Online"
6267

6368
# REBUILD CMS
64-
herccontrol "/logon maint cpcms" -w "^VM Community Edition V1 R1.2"
69+
herccontrol "/logon maint cpcms" -w "^VM Community Edition"
6570
herccontrol "/access (noprof" -w "^Ready;"
6671
herccontrol "/profile" -w "^Ready;"
6772
herccontrol "/NEWBREXX" -w "^Ready"
6873
herccontrol "/define storage 16m" -w "CP ENTERED"
69-
herccontrol "/ipl 190 clear" -w "^VM Community Edition V1 R1.2"
70-
herccontrol "/savesys cms" -w "^VM Community Edition V1 R1.2"
74+
herccontrol "/ipl 190 clear" -w "^VM Community Edition"
75+
herccontrol "/savesys cms" -w "^VM Community Edition"
7176
herccontrol "/" -w "^Ready;"
7277
herccontrol "/logoff" -w "^VM/370 Online"
7378

changelog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
VM/370 Docker Container - Changelog
22
===================================
3+
1.6.8 - Build Hercules from source to pick up fix for SDL Hyperion issue #782.
4+
35
1.6.7 - Add Python.
46
Replace HercControl 1.1.2 with PyHercControl 1.1.2.
57

start_vm370.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
#!/bin/sh
22
# Start Hercules
3-
mkdir io >/dev/null 2>/dev/null | true
3+
4+
# Add Hercules to paths
5+
. /opt/hercules/vm370/setup.sh
6+
7+
mkdir io >/dev/null 2>/dev/null || true
48
hercules -f hercules.conf -d >/dev/null 2>/dev/null

uprepro.bat

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@REM Script to update container repositories
2+
3+
@SET TAG=%~1
4+
@SET REPO=rosspatterson
5+
6+
@IF "%TAG%" EQU "" (
7+
ECHO Syntax: %0 tagname
8+
EXIT /B 1
9+
)
10+
11+
@REM Docker Tagging (builder, test and latest)
12+
docker pull %REPO%/vm370:%TAG%
13+
14+
docker tag %REPO%/vm370:%TAG% %REPO%/vm370:builder
15+
docker push %REPO%/vm370:builder
16+
17+
@REM docker tag %REPO%/vm370:%TAG% %REPO%/vm370:test
18+
@REM docker push %REPO%/vm370:test
19+
20+
docker tag %REPO%/vm370:%TAG% %REPO%/vm370:latest
21+
docker push %REPO%/vm370:latest

uprepro.sh

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
#!/bin/sh
22
# Script to update container repositories
33

4-
TAG=1.5.3
4+
TAG=$1
5+
REPO=rosspatterson
6+
7+
if [ "$TAG" = "" ] ; then
8+
echo "Syntax: $0 tagname"
9+
exit 1
10+
fi
11+
12+
set -x
13+
514
# Docker Tagging (builder, test and latest)
6-
docker pull adriansutherland/vm370:$TAG
7-
docker tag adriansutherland/vm370:$TAG adriansutherland/vm370:builder
8-
docker push adriansutherland/vm370:builder
15+
docker pull $REPO/vm370:$TAG
916

10-
docker pull adriansutherland/vm370:$TAG
11-
docker tag adriansutherland/vm370:$TAG adriansutherland/vm370:test
12-
docker push adriansutherland/vm370:test
17+
docker tag $REPO/vm370:$TAG $REPO/vm370:builder
18+
docker push $REPO/vm370:builder
1319

14-
docker pull adriansutherland/vm370:$TAG
15-
docker tag adriansutherland/vm370:$TAG adriansutherland/vm370:latest
16-
docker push adriansutherland/vm370:latest
20+
docker tag $REPO/vm370:$TAG $REPO/vm370:test
21+
docker push $REPO/vm370:test
1722

18-
# Upload Image to Google Cloud
19-
# GCLOUD SDK needs to be installed, then linked to Docker Desktop
20-
# gcloud auth configure-docker
21-
#docker pull adriansutherland/vm370:test
22-
#docker tag adriansutherland/vm370:test gcr.io/utility-ridge-243715/vm370:test
23-
#docker push gcr.io/utility-ridge-243715/vm370:test
23+
docker tag $REPO/vm370:$TAG $REPO/vm370:latest
24+
docker push $REPO/vm370:latest

0 commit comments

Comments
 (0)