Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,22 @@ jobs:
run: |
docker tag opensourcecobol/opensourcecobol4j:"$version_string_prefix" opensourcecobol/opensourcecobol4j:latest

- name: Show Docker image size
run: |
docker images opensourcecobol/opensourcecobol4j:"$version_string_prefix" --format "table {{.Repository}}:{{.Tag}}\t{{.Size}}"

- name: Check the version of installed software
run: |
docker run --rm opensourcecobol/opensourcecobol4j:latest sh -c "cobj --version | grep 'opensource COBOL 4J $opensource_COBOL_4J_version'"
docker run --rm opensourcecobol/opensourcecobol4j:latest sh -c "! cobj --version | grep 'unicode/utf-8 support'"
docker run --rm opensourcecobol/opensourcecobol4j:latest sh -c "ocesql --version | grep 'Version $Open_COBOL_ESQL_4J_version'"

- name: Run simple tests inside the container
run: |
docker run -itd --name test_container opensourcecobol/opensourcecobol4j:latest
docker exec test_container sh -c "cd /root/cobol_sample && cobj HELLO.cbl && java HELLO"
docker rm -f test_container

- name: Login to Docker Hub
if: github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch' && inputs.push_to_dockerhub == true
uses: docker/login-action@v3
Expand Down Expand Up @@ -73,11 +83,21 @@ jobs:
docker build -t opensourcecobol/opensourcecobol4j:utf8-"$version_string_prefix" . -f utf8.Dockerfile \
--build-arg opensource_COBOL_4J_version="$opensource_COBOL_4J_version"

- name: Show Docker image size
run: |
docker images opensourcecobol/opensourcecobol4j:utf8-"$version_string_prefix" --format "table {{.Repository}}:{{.Tag}}\t{{.Size}}"

- name: Check the version of installed software
run: |
docker run --rm opensourcecobol/opensourcecobol4j:utf8-"$version_string_prefix" sh -c "cobj --version | grep 'opensource COBOL 4J $opensource_COBOL_4J_version'"
docker run --rm opensourcecobol/opensourcecobol4j:utf8-"$version_string_prefix" sh -c "cobj --version | grep 'unicode/utf-8 support'"

- name: Run simple tests inside the container
run: |
docker run -itd --name test_container opensourcecobol/opensourcecobol4j:utf8-"$version_string_prefix"
docker exec test_container sh -c "cd /root/cobol_sample && cobj HELLO.cbl && java HELLO"
docker rm -f test_container

- name: Login to Docker Hub
if: github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch' && inputs.push_to_dockerhub == true
uses: docker/login-action@v3
Expand Down
18 changes: 9 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Build stage
FROM almalinux:9 AS builder
FROM almalinux:9-minimal AS builder

ARG opensource_COBOL_4J_version=dummy_value Open_COBOL_ESQL_4J_version=dummy_value

SHELL ["/bin/bash", "-c"]

# install build dependencies
RUN dnf update -y && \
dnf install -y gcc make bison flex automake autoconf diffutils gettext java-11-openjdk-devel && \
dnf clean all
RUN microdnf update -y && \
microdnf install -y gcc make bison flex automake autoconf diffutils gettext java-11-openjdk-devel tar gzip && \
microdnf clean all

# install sbt
RUN curl -fL https://github.com/coursier/coursier/releases/latest/download/cs-x86_64-pc-linux.gz | gzip -d > cs && \
Expand Down Expand Up @@ -43,17 +43,17 @@ RUN cd /root/ && \
rm -rf /root/Open-COBOL-ESQL-4j-${Open_COBOL_ESQL_4J_version}.tar.gz /root/Open-COBOL-ESQL-4j-${Open_COBOL_ESQL_4J_version}

# Runtime stage
FROM almalinux:9
FROM almalinux:9-minimal

ARG opensource_COBOL_4J_version=dummy_value Open_COBOL_ESQL_4J_version=dummy_value

SHELL ["/bin/bash", "-c"]

# install runtime dependencies only
RUN dnf update -y && \
dnf install -y java-11-openjdk-devel && \
dnf clean all && \
rm -rf /var/cache/dnf/*
RUN microdnf update -y && \
microdnf install -y java-11-openjdk-devel && \
microdnf clean all && \
rm -rf /var/cache/microdnf/*

# create required directories
RUN mkdir -p /usr/lib/opensourcecobol4j \
Expand Down
32 changes: 20 additions & 12 deletions utf8.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Build stage
FROM almalinux:9 AS builder
FROM almalinux:9-minimal AS builder

ARG opensource_COBOL_4J_version=dummy_value

SHELL ["/bin/bash", "-c"]

# install build dependencies
RUN dnf update -y && \
dnf install -y gcc make bison flex automake autoconf diffutils gettext java-11-openjdk-devel && \
dnf clean all
RUN microdnf update -y && \
microdnf install -y gcc make bison flex automake autoconf diffutils gettext java-11-openjdk-devel tar gzip && \
microdnf clean all

# install sbt
RUN curl -fL https://github.com/coursier/coursier/releases/latest/download/cs-x86_64-pc-linux.gz | gzip -d > cs && \
Expand All @@ -20,26 +20,34 @@ RUN cd /root && \
curl -L -o opensourcecobol4j-v${opensource_COBOL_4J_version}.tar.gz https://github.com/opensourcecobol/opensourcecobol4j/archive/refs/tags/v${opensource_COBOL_4J_version}.tar.gz && \
tar zxvf opensourcecobol4j-v${opensource_COBOL_4J_version}.tar.gz && \
cd opensourcecobol4j-${opensource_COBOL_4J_version} && \
mkdir -p /tmp/usr/ &&\
./configure --prefix=/tmp/usr/ --enable-utf8 && \
./configure --prefix=/usr/ --enable-utf8 && \
touch cobj/*.m4 && \
make && \
make install && \
rm -rf /root/opensourcecobol4j-v${opensource_COBOL_4J_version}.tar.gz /root/opensourcecobol4j-${opensource_COBOL_4J_version}

# Runtime stage
FROM almalinux:9
FROM almalinux:9-minimal

ARG opensource_COBOL_4J_version=dummy_value

SHELL ["/bin/bash", "-c"]

# install runtime dependencies only
RUN dnf update -y && \
dnf install -y java-11-openjdk-devel && \
dnf clean all && \
rm -rf /var/cache/dnf/*
RUN microdnf update -y && \
microdnf install -y java-11-openjdk-devel && \
microdnf clean all && \
rm -rf /var/cache/microdnf/*

# copy built files from builder stage
COPY --from=builder /tmp/usr/ /usr/
COPY --from=builder /usr/lib/opensourcecobol4j/ /usr/lib/opensourcecobol4j/
COPY --from=builder /usr/bin/cob-config /usr/bin/cob-config
COPY --from=builder /usr/bin/cobj /usr/bin/cobj
COPY --from=builder /usr/bin/cobj-api /usr/bin/cobj-api
COPY --from=builder /usr/bin/cobj-idx /usr/bin/cobj-idx
COPY --from=builder /usr/bin/cobjrun /usr/bin/cobjrun
COPY --from=builder /usr/include/libcobj.h /usr/include/libcobj.h
COPY --from=builder /usr/share/opensource-cobol-4j-${opensource_COBOL_4J_version} /usr/share/opensource-cobol-4j-${opensource_COBOL_4J_version}

# classpath settings
ENV CLASSPATH=:/usr/lib/opensourcecobol4j/libcobj.jar
Expand Down