Skip to content

Strange libgdal.so.28 issue #120

@jlgutenson

Description

@jlgutenson

Describe the bug
I'm having an issue with a libgdal.so.28 dependency somewhere in go-consequences when setting up and running go-consequences using Docker Desktop on Windows. The error is:

/app/main: error while loading shared libraries: libgdal.so.28: cannot open shared object file: No such file or directory

after attempting to run a flood consequence assessment with the command:

docker run --mount type=bind,source="C:\Users\jlgut\OneDrive\Desktop\go-consequences",target=/data go-consequences-jlg:latest ./main "/data/joseph_test.json"

To Reproduce
Steps to reproduce the behavior:

  1. Go to a local directory of the go-consequences Github repo (e.g., C:\Users\jlgut\OneDrive\Desktop\go-consequences).
  2. Modify Dockerfile.prod because of initial issue with not finding the /main executable:
# Stage 1: Builder
FROM debian:bullseye AS builder

ENV TZ=America/New_York
ENV PATH=/go/bin:$PATH
ENV GOROOT=/go
ENV GOPATH=/src/go

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone &&\
    mkdir -p /go &&\
    mkdir -p /src/go &&\
    apt update &&\
    apt -y install build-essential &&\
    apt -y install gdal-bin gdal-data libgdal-dev &&\
    apt -y install wget &&\
    wget https://golang.org/dl/go1.19.5.linux-amd64.tar.gz -P / &&\
    tar -xvzf /go1.19.5.linux-amd64.tar.gz -C / &&\
    apt -y install vim &&\
    apt -y install git

WORKDIR /app
RUN git clone https://github.com/USACE/go-consequences.git
WORKDIR /app/go-consequences
RUN go mod download
RUN go mod tidy
RUN go build -o main .

# Stage 2: Production
FROM ghcr.io/osgeo/gdal:ubuntu-full-3.8.3 AS prod

# Install GDAL and related libraries
RUN apt update && apt -y install gdal-bin gdal-data libgdal-dev

WORKDIR /app
COPY --from=builder /app/go-consequences/main ./

# Ensure the GDAL library is available
RUN ldconfig

ENTRYPOINT ["/app/main"]
  1. Build the Docker Image with the command docker build -f Dockerfile.prod -t go-consequences-jlg .
  2. Attempt to run go-consequences from command line docker run --mount type=bind,source="C:\Users\jlgut\OneDrive\Desktop\go-consequences",target=/data go-consequences-jlg:latest ./main "/data/joseph_test.json"
  3. See error: /app/main: error while loading shared libraries: libgdal.so.28: cannot open shared object file: No such file or directory

Expected behavior
I was expecting to have go-consequences run this test-case (i.e., joseph_test.json):

{
    "structure_provider_info": {
        "structure_provider_type": "NSIAPI"
    },
    "hazard_provider_info": {
        "hazards": [
            {
                "hazard_parameter_type": "depth",
                "hazard_provider_file_path": "/data/MO_FABDEM_ARC_Flood_Forecast_20241030.shp"
            }
        ]
    },
    "results_writer_info": {
        "results_writer_type": "JSON",
        "output_file_path": "/data/MO_FABDEM_ARC_Flood_Forecast_20241030.json"
    }
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions