I am working on a assignment but needed to rebuild my Dockerfile to expose an extra port. The container was working fine before hand, but when I attempted to rebuild it I kept on getting an error that was related to some invalid ELF header. I tried commenting out all the terminal commands written in the Docker File (see below), and got the image to build, but now when I run it I get another invalid ELF header issue.
# TODO: set base image
FROM ubuntu:22.04
ARG IMAGE_NAME=nets2120
# Install packages
# TODO: Add packages (reference handout)
# RUN apt-get update
# && \
# apt-get install -y \
# wget \
# curl \
# tar \
# unzip \
# openjdk-21-jdk \
# maven \
# nodejs \
# npm \
# nginx
# Set up Spark
ENV SPARK_VERSION=3.5.0 \
HADOOP_VERSION=3
ENV SPARK_HOME=/usr/local/spark-$SPARK_VERSION-bin-hadoop$HADOOP_VERSION
# RUN wget -q https://dlcdn.apache.org/spark/spark-$SPARK_VERSION/spark-$SPARK_VERSION-bin-hadoop$HADOOP_VERSION.tgz -O spark.tgz
# RUN tar -xzf spark.tgz -C /usr/local \
# && ln -s /usr/local/spark-$SPARK_VERSION-bin-hadoop$HADOOP_VERSION /usr/local/spark
# RUN rm spark.tgz
# Set up Livy
ENV LIVY_VERSION=0.8.0 \
INCUBATING_VERSION=2.11
ENV LIVY_HOME=/usr/local/apache-livy-$LIVY_VERSION-incubating_$INCUBATING_VERSION-bin
# RUN wget -q https://dlcdn.apache.org/incubator/livy/$LIVY_VERSION-incubating/apache-livy-$LIVY_VERSION-incubating_$INCUBATING_VERSION-bin.zip -O livy.zip
# RUN unzip livy.zip -d /usr/local && ln -s $LIVY_HOME /usr/local/livy
# RUN rm livy.zip
# Update PATH
ENV PATH=$PATH:$SPARK_HOME/bin:$LIVY_HOME/bin
# TODO: Set up ports (80 for Nginx, 4567 for SparkJava, 8080 for Spark UI, 8998 for Livy)
EXPOSE 80
EXPOSE 4567
EXPOSE 8080
EXPOSE 8998
EXPOSE 3000
# Set working directory
WORKDIR /$IMAGE_NAME
# Clean up to reduce image size
# RUN apt-get clean && rm -rf /var/lib/apt/lists/*
The error when I run the container is
2024-03-11 08:44:52 /bin/bash: error while loading shared libraries: /lib/x86_64-linux-gnu/libtinfo.so.6: invalid ELF header
It then immediately stops running
As mentioned initially I was getting an error similar to above when the Docker builder hit the apt-get lines, so I commented it all out, but now I am getting a similar error when running the stripped container leading me to believe the issue is more broad. Would appreciate any advice to help with this.