diff --git a/Dockerfile b/Dockerfile index 7003e59..a218586 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,49 +2,50 @@ FROM ubuntu:latest COPY . . +# Install dependencies +RUN apt-get update -y +RUN apt-get install -y git +RUN apt-get install -y python3-pip +RUN apt-get install -y python3 +RUN apt-get install -y nodejs +RUN apt-get install -y vim +RUN apt-get install -y curl +RUN apt-get install -y iputils-ping +RUN apt-get install -y postgresql-client +RUN apt-get install -y wget +RUN apt-get install -y libaio1t64 +RUN apt-get install -y unzip +RUN rm -rf /var/lib/apt/lists/* + + # Set environment variables for Oracle Instant Client ENV ORACLE_HOME=/opt/oracle ENV LD_LIBRARY_PATH=$ORACLE_HOME -# Define Oracle Instant Client download URLs + +# Define the Oracle Instant Client download URLs ENV BASIC_ZIP_URL="https://download.oracle.com/otn_software/linux/instantclient/2350000/instantclient-basic-linux.x64-23.5.0.24.07.zip" ENV SQLPLUS_ZIP_URL="https://download.oracle.com/otn_software/linux/instantclient/2350000/instantclient-sqlplus-linux.x64-23.5.0.24.07.zip" -# Install dependencies in one RUN statement, clean up apt cache -RUN apt-get update && \ -apt-get install -y --no-install-recommends \ - git \ - nodejs \ - vim \ - curl \ - iputils-ping \ - postgresql-client \ - wget \ - libaio1 \ - unzip && \ - rm -rf /var/lib/apt/lists/* - -# Download and set up Oracle Instant Client +# Download Oracle Instant Client files RUN wget --no-check-certificate "${BASIC_ZIP_URL}" -O /tmp/instantclient-basic.zip && \ - wget --no-check-certificate "${SQLPLUS_ZIP_URL}" -O /tmp/instantclient-sqlplus.zip && \ - mkdir -p ${ORACLE_HOME} && \ - unzip -q /tmp/instantclient-basic.zip -d /tmp/oracle_basic && \ - unzip -q /tmp/instantclient-sqlplus.zip -d /tmp/oracle_sqlplus && \ - mv /tmp/oracle_basic/instantclient_*/* ${ORACLE_HOME}/ && \ - mv /tmp/oracle_sqlplus/instantclient_*/* ${ORACLE_HOME}/ && \ - ln -s ${ORACLE_HOME}/instantclient ${ORACLE_HOME}/instantclient && \ - ln -s ${ORACLE_HOME}/sqlplus /usr/bin/sqlplus && \ - ln -s /usr/lib/*-linux-gnu/libaio.so.1 /usr/lib/libaio.so.1 && \ - rm -rf /tmp/* - -# Copy application files into the container -COPY . . + wget --no-check-certificate "${SQLPLUS_ZIP_URL}" -O /tmp/instantclient-sqlplus.zip + +# Unzip and set up Oracle Instant Client +RUN mkdir -p ${ORACLE_HOME} +RUN unzip "/tmp/instantclient-basic.zip" -d /tmp/oracle_basic +RUN unzip "/tmp/instantclient-sqlplus.zip" -d /tmp/oracle_sqlplus +RUN mv /tmp/oracle_basic/instantclient_*/* ${ORACLE_HOME}/ +RUN mv /tmp/oracle_sqlplus/instantclient_*/* ${ORACLE_HOME}/ +RUN rm -rf /tmp +RUN ln -s ${ORACLE_HOME}/instantclient ${ORACLE_HOME}/instantclient +RUN ln -s ${ORACLE_HOME}/sqlplus /usr/bin/sqlplus + +RUN ln -s /usr/lib/*-linux-gnu/libaio.so.1t64 ${ORACLE_HOME}/libaio.so.1 + -# Install Python dependencies -RUN pip install --no-cache-dir -r requirements.txt +RUN pip install -r requirements.txt --break-system-packages -# Expose the port the app runs on EXPOSE 8080 -# Set the entrypoint for the container -ENTRYPOINT ["python3", "./status.py"] +ENTRYPOINT ["python3", "./status.py"] \ No newline at end of file diff --git a/README.md b/README.md index 9485531..63da40e 100644 --- a/README.md +++ b/README.md @@ -43,3 +43,8 @@ To build and run the Docker image locally, use the following commands: docker build -t ubuntu-vm . docker run -d -p 8080:8080 ubuntu-vm ``` + +If you use MAC with arm processor +```shell +docker buildx build --platform=linux/amd64 -t ubuntu-vm . +``` \ No newline at end of file