Forum > Other

Docker image which can build both 16 and 32-bit MS-DOS apps

(1/1)

kveroneau:
I thought this would be the best sub-forum to post this under...

Do you need a consistent easy to grab development environment to build both 16-bit real-mode and 32-bit protected mode ObjectPascal programs in?  Well, I have the solution for you!  If you have access to Docker, either in a VM on Windows/Mac, or natively on your Linux workstation, you can either build my Dockerfile yourself with your own customization and FPC version, or pull a ready made FPC 3.2.0 RC1 Docker image I slapped together today!

I have tested both the i8086 and GO32v2 FPC targets in this Docker image and can confirm they run in DOS as expected.  This is a beta version of the next FPC release, so be warned that there might be some bugs and such, but this could be your chance to try compiling your current 16-bit and 32-bit programs on the latest and greatest FPC version to see if they run as expected and of course open bug reports if you notice anything off.

Dockerfile in my GitHub repo: https://github.com/kveroneau/fpc-docker/tree/master/Builder/fpc320

Docker image in Docker Hub: https://hub.docker.com/layers/kveroneau/fpc/3.2.0/images/sha256-e64ed3081691278903372ef8c5db72338bff6e4af4f5a7f964bc0045db93d4fd?context=explore

Command you can run right now(if you have Docker installed):


--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---$ docker run -it --rm -v `pwd`:/usr/src kveroneau/fpc:3.2.0 
This will make your current working directory available under /usr/src in the Docker container when it runs, so run this command in a directory where you have some source code you'd like to try and compile against FPC 3.2.0.

Here is how you can build for each target:


--- Code: GNU make  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---all: hello.com hello.exe hello32.exe hello.com: hello.pas        ppcross8086 -o$@ -WmTiny -Wtcom $< hello.exe: hello.pas        ppcross8086 -o$@ -WmTiny -Wtexe $< hello32.exe: hello.pas        ppcross386 -o$@ -Tgo32v2 $< clean:        rm -rf *.com *.exe *.a *.o 
If you used the docker command-line provided above, your host operating system should now contain a couple .EXE files and a .COM file within the same source directory you shared with the Docker container.  Easy stuff.

What is even cooler about this, is that you can create a nice shell script to run a Makefile from the current directory inside the Docker container, eg:


--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---#!/bin/sh docker run -it --rm -v `pwd`:/usr/src kveroneau/fpc:3.2.0 make "$@" 
Running this script will spin up a temporary docker container to clean-room build your sources in the current directory using a modern Makefile.  When the docker container finishes, you should then see your binary files and also see the output from Make on your standard output.  This can obviously be used on something like a build server like Jenkins or CircleCI to automate builds.

Let me know if anybody has any questions, or needs some assistance in getting Docker up and running on their machines.

kveroneau:
Just pushed a new Docker image for FPC 3.2.2, the current stable release.

https://hub.docker.com/repository/registry-1.docker.io/kveroneau/fpc/tags

This image contains the standard AMD64 compiler, along with both the Go32v2 and the i8086 builder.

The Git repo has also been updated with the latest Dockerfile and related files here:
https://github.com/kveroneau/fpc-docker/tree/master/Builder/fpc322

It can be used in the exact same way as the previous image.

Ñuño_Martínez:
Great.  I have to remember this, and test it.

Thanks for the effort.

Navigation

[0] Message Index

Go to full version