Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ on:
branches: [develop, main]
tags:
- 'v*'

workflow_dispatch:
inputs:
GDAL_VER:
description: "GDAL version to use for Docker build"
required: false
default: "3.12.1"
jobs:
# ------------------------------------------------------------
# Resolve release tag from ref
Expand Down Expand Up @@ -77,7 +82,15 @@ jobs:
}
EOF
fi

- name: Resolve GDAL version
id: gdal
run: |
if [[ -n "${{ github.event.inputs.GDAL_VER }}" ]]; then
GDAL_VER="${{ github.event.inputs.GDAL_VER }}"
else
GDAL_VER="3.12.1"
fi
echo "GDAL_VER=${GDAL_VER}" >> $GITHUB_ENV
- name: Build image with Kaniko (to tar)
uses: docker://gcr.io/kaniko-project/executor:debug
env:
Expand All @@ -86,6 +99,7 @@ jobs:
args: >
--context .
--dockerfile Dockerfile
--build-arg GDAL_VER=${{ env.GDAL_VER }}
--no-push
--tar-path image.tar

Expand Down
38 changes: 36 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ RUN apt-get update && apt-get install -y \
tree \
podman \
skopeo \
&& apt-get remove -y yq \
&& rm -rf /var/lib/apt/lists/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xmichele can you add this line after gdal installation

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fabricebrito added with last develop commit.
Introduced also an optional parameter GDAL_VER propagated till the docker build command to chose the gdal version to pre-install

&& apt-get remove -y yq && \
rm -rf /var/lib/apt/lists/*

# -------------------------------------------------------------------
# Create user
Expand Down Expand Up @@ -113,13 +113,47 @@ RUN curl -fsSL \
dpkg -i /tmp/trivy.deb && \
rm /tmp/trivy.deb

#gdal
ARG GDAL_VER=3.12.1
# fetch, build, install
RUN apt-get update && apt-get install -qy \
cmake ninja-build libproj-dev proj-data proj-bin; \
set -e; \
cd /tmp; \
curl -fsSL -o gdal-${GDAL_VER}.tar.xz https://download.osgeo.org/gdal/${GDAL_VER}/gdal-${GDAL_VER}.tar.xz \
|| curl -fsSL -o gdal-${GDAL_VER}.tar.gz https://download.osgeo.org/gdal/${GDAL_VER}/gdal-${GDAL_VER}.tar.gz; \
if [ -f gdal-${GDAL_VER}.tar.xz ]; then \
tar -xJf gdal-${GDAL_VER}.tar.xz; \
else \
tar -xzf gdal-${GDAL_VER}.tar.gz; \
fi; \
cd gdal-${GDAL_VER}; \
mkdir build && cd build; \
cmake -G Ninja ../ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local; \
cmake --build . -- -j"$(nproc)"; \
cmake --install .; \
ldconfig; \
rm -rf /tmp/gdal-${GDAL_VER}*; \
rm -rf /var/lib/apt/lists/*; \
gdal-config --version

#####

# -------------------------------------------------------------------
# Entrypoint
# -------------------------------------------------------------------
COPY entrypoint.sh /opt/entrypoint.sh
RUN chmod +x /opt/entrypoint.sh

USER ${USER}

ENV GDAL_CONFIG=/usr/local/bin/gdal-config
ENV GDAL_DATA=/usr/local/share/gdal
ENV GDAL_DRIVER_PATH=/usr/local/lib/gdalplugins
ENV GDAL_OVERWRITE=YES

WORKDIR /workspace

EXPOSE 8888
Expand Down
2 changes: 1 addition & 1 deletion release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image_name: pde-code-server
image_prefix: eoepca
image_version: 1.2.0
image_version: 1.3.0
image_registry: ghcr.io