Docker Community Forums

Share and learn in the Docker community.

Unable to load shared object; invalid ELF header

I am attempting to create a container that runs an R script which calls a .DLL

The line in my Rscript uses dyn.load.

The image build seems ok.

When doing docker run, I get error:

Error in dyn.load(“vollib.dll”) :
unable to load shared object ‘//vollib.dll’:
//vollib.dll: invalid ELF header
Execution halted

My dockerfile is:

start from the rocker/r-ver:3.5.0 image

FROM rocker/r-ver:3.5.0

install the linux libraries needed for plumber

RUN apt-get update -qq && apt-get install -y

install plumber

RUN R -e “install.packages(‘plumber’)”

install plumber

RUN R -e “install.packages(‘dplyr’)”

copy everything from the current directory into the container


Copy the current directory contents into the container at /app

COPY . /app

open port 80 to traffic


when the container starts, start the main.R script

ENTRYPOINT [“Rscript”, “main.R”]

Any suggestions?

Hi :slight_smile:

The invalid elf header error, is most likely because you try to load a 32bit dll into a 64bit system.
Im no expert in R, but … a DLL file on a unix based system ? i could be wrong but i have never seen that :wink: