Skip to content

Commit

Permalink
[Update]: use opensource COBOL 4J 1.1.2 (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
yutaro-sakamoto committed Aug 28, 2024
1 parent e34184c commit f275077
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 20 deletions.
32 changes: 13 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:22.04
FROM almalinux:9

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

Expand All @@ -7,37 +7,31 @@ ENV CLASSPATH :/usr/lib/opensourcecobol4j/libcobj.jar:/usr/lib/Open-COBOL-ESQL-4
RUN echo 'export CLASSPATH=:/usr/lib/opensourcecobol4j/libcobj.jar:/usr/lib/Open-COBOL-ESQL-4j/postgresql.jar:/usr/lib/Open-COBOL-ESQL-4j/ocesql4j.jar' >> ~/.bashrc

# install dependencies
RUN apt-get update
RUN apt-get install -y default-jdk build-essential bison flex gettext texinfo autoconf unzip zip gnupg
RUN dnf update -y
RUN dnf install -y gcc make bison flex automake autoconf diffutils gettext java-11-openjdk-devel

# install sbt
RUN echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | tee /etc/apt/sources.list.d/sbt.list &&\
echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | tee /etc/apt/sources.list.d/sbt_old.list &&\
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | apt-key add
RUN apt-get update && apt-get install -y sbt
RUN curl -fL https://github.com/coursier/coursier/releases/latest/download/cs-x86_64-pc-linux.gz | gzip -d > cs && chmod +x cs && echo Y | ./cs setup

# install opensourcecobol4j
RUN cd /root &&\
curl -L -o opensourcecobol4j-v1.1.1.tar.gz https://github.com/opensourcecobol/opensourcecobol4j/archive/refs/tags/v1.1.1.tar.gz &&\
tar zxvf opensourcecobol4j-v1.1.1.tar.gz &&\
cd opensourcecobol4j-1.1.1 &&\
curl -L -o opensourcecobol4j-v1.1.2.tar.gz https://github.com/opensourcecobol/opensourcecobol4j/archive/refs/tags/v1.1.2.tar.gz &&\
tar zxvf opensourcecobol4j-v1.1.2.tar.gz &&\
cd opensourcecobol4j-1.1.2 &&\
./configure --prefix=/usr/ &&\
make &&\
make install &&\
rm ../opensourcecobol4j-v1.1.1.tar.gz
rm ../opensourcecobol4j-v1.1.2.tar.gz

# Install Open COBOL ESQL 4J
ADD Open-COBOL-ESQL-4j /root/Open-COBOL-ESQL-4j
ENV PATH="$PATH:/root/.local/share/coursier/bin"
RUN mkdir -p /usr/lib/Open-COBOL-ESQL-4j &&\
curl -L -o /usr/lib/Open-COBOL-ESQL-4j/postgresql.jar https://jdbc.postgresql.org/download/postgresql-42.2.24.jre6.jar &&\
cd /root &&\
curl -L -o Open-COBOL-ESQL-4j-v1.0.3.tar.gz https://github.com/opensourcecobol/Open-COBOL-ESQL-4j/archive/refs/tags/v1.0.3.tar.gz &&\
tar zxvf Open-COBOL-ESQL-4j-v1.0.3.tar.gz &&\
cd Open-COBOL-ESQL-4j-1.0.3 &&\
cp /usr/lib/Open-COBOL-ESQL-4j/postgresql.jar dblibj/lib &&\
cd /root/Open-COBOL-ESQL-4j &&\
cp /usr/lib/opensourcecobol4j/libcobj.jar dblibj/lib &&\
./configure --prefix=/usr/ &&\
make &&\
make install &&\
rm ../Open-COBOL-ESQL-4j-v1.0.3.tar.gz
make install

# add sample programs
ADD cobol_sample /root/cobol_sample
Expand Down
2 changes: 1 addition & 1 deletion docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
- "5432:5432"

oc4j_client:
image: opensourcecobol/opensourcecobol4j:1.1.1
image: opensourcecobol/opensourcecobol4j:1.1.2
container_name: oc4j_client
stdin_open: true
tty: true
Expand Down

0 comments on commit f275077

Please sign in to comment.