Skip to content

Instantly share code, notes, and snippets.

@up1
Last active June 11, 2020 15:42
Show Gist options
  • Save up1/4967faea083439899f57247ab87a9053 to your computer and use it in GitHub Desktop.
Save up1/4967faea083439899f57247ab87a9053 to your computer and use it in GitHub Desktop.
Docker with COBOL
FROM ubuntu:16.04
#update and get pre-requisites
RUN apt-get update && apt-get install -y \
open-cobol \
gcc
#copy file to image
COPY helloworld.cbl /helloworld.cbl
#compile the code
RUN cobc -x -free -o helloworld helloworld.cbl
#run
CMD ["/helloworld"]
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD.
*> My hello world program
PROCEDURE DIVISION.
DISPLAY 'Hello world from COBOL'.
STOP RUN.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment