Skip to content

Commit 1bc263e

Browse files
authored
Update Dockerfile (#32)
1 parent 1c537e9 commit 1bc263e

File tree

2 files changed

+60
-62
lines changed

2 files changed

+60
-62
lines changed

.github/workflows/docker-image.yml

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,62 @@
11
name: Build Docker Image
22

33
on:
4-
release:
5-
types: [published]
6-
push:
7-
branches:
8-
- master
9-
pull_request:
10-
types: [opened, synchronize, reopened]
4+
release:
5+
types: [published]
6+
push:
7+
branches:
8+
- master
9+
pull_request:
10+
types: [opened, synchronize, reopened]
1111

1212
jobs:
13-
build-and-push:
14-
runs-on: ubuntu-latest
15-
permissions:
16-
contents: read
17-
packages: write
18-
19-
steps:
20-
- name: Checkout code
21-
uses: actions/checkout@v4
22-
23-
- name: Set up Docker Buildx
24-
uses: docker/setup-buildx-action@v3
25-
26-
- name: Log in to GitHub Container Registry (ghcr.io)
27-
uses: docker/login-action@v3
28-
with:
29-
registry: ghcr.io
30-
username: ${{ github.actor }}
31-
password: ${{ secrets.GITHUB_TOKEN }}
32-
33-
- name: Set Docker image tags
34-
id: meta
35-
run: |
36-
REPO=ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}
37-
38-
if [[ "${{ github.event_name }}" == "release" ]]; then
39-
VERSION_TAG=${{ github.event.release.tag_name }}
40-
echo "tags<<EOF" >> $GITHUB_OUTPUT
41-
echo "${REPO}:${VERSION_TAG}" >> $GITHUB_OUTPUT
42-
echo "${REPO}:latest" >> $GITHUB_OUTPUT
43-
echo "EOF" >> $GITHUB_OUTPUT
44-
45-
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
46-
PR_NUMBER=${{ github.event.pull_request.number }}
47-
echo "tags=${REPO}:pr-${PR_NUMBER}" >> $GITHUB_OUTPUT
48-
49-
else
50-
echo "tags=${REPO}:dev" >> $GITHUB_OUTPUT
51-
fi
52-
53-
- name: Build and push multi-platform image
54-
uses: docker/build-push-action@v6
55-
with:
56-
context: .
57-
platforms: linux/amd64,linux/arm64
58-
push: true
59-
tags: ${{ steps.meta.outputs.tags }}
60-
provenance: false
61-
cache-from: type=gha
62-
cache-to: type=gha,mode=max
13+
build-and-push:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v3
25+
26+
- name: Log in to GitHub Container Registry (ghcr.io)
27+
uses: docker/login-action@v3
28+
with:
29+
registry: ghcr.io
30+
username: ${{ github.actor }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Set Docker image tags
34+
id: meta
35+
run: |
36+
REPO=ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}
37+
38+
if [[ "${{ github.event_name }}" == "release" ]]; then
39+
VERSION_TAG=${{ github.event.release.tag_name }}
40+
echo "tags<<EOF" >> $GITHUB_OUTPUT
41+
echo "${REPO}:${VERSION_TAG}" >> $GITHUB_OUTPUT
42+
echo "${REPO}:latest" >> $GITHUB_OUTPUT
43+
echo "EOF" >> $GITHUB_OUTPUT
44+
45+
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
46+
PR_NUMBER=${{ github.event.pull_request.number }}
47+
echo "tags=${REPO}:pr-${PR_NUMBER}" >> $GITHUB_OUTPUT
48+
49+
else
50+
echo "tags=${REPO}:dev" >> $GITHUB_OUTPUT
51+
fi
52+
53+
- name: Build and push multi-platform image
54+
uses: docker/build-push-action@v6
55+
with:
56+
context: .
57+
platforms: linux/amd64,linux/arm64
58+
push: true
59+
tags: ${{ steps.meta.outputs.tags }}
60+
provenance: false
61+
cache-from: type=gha
62+
cache-to: type=gha,mode=max

Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ RUN apt-get update && \
1616
&& apt-get clean && rm -rf /var/lib/apt/lists/* && \
1717
ln -s $CONDA_DIR/share/bash-completion/completions/gdal /etc/bash_completion.d/gdal && \
1818
echo 'source /etc/bash_completion' >> /etc/bash.bashrc
19-
# ------------------------------
20-
# 2. Install conda packages into base env
21-
# ------------------------------
19+
2220
# ------------------------------
2321
# 2. Install conda packages into base env
2422
# ------------------------------
@@ -41,7 +39,7 @@ RUN ln -s $CONDA_PREFIX/lib/libsqlite3.so.3.50.0 $CONDA_PREFIX/lib/libsqlite3.so
4139
&& ln -s $CONDA_PREFIX/lib/libsqlite3.so.3.50.0 $CONDA_PREFIX/lib/libsqlite3.so.0
4240

4341
# ------------------------------
44-
# 3. Set geospatial environment variables
42+
# 3. Set pygis environment variables
4543
# ------------------------------
4644
ENV PROJ_LIB=$CONDA_DIR/share/proj \
4745
GDAL_DATA=$CONDA_DIR/share/gdal \
@@ -54,7 +52,7 @@ COPY . /home/jovyan/pygis
5452
WORKDIR /home/jovyan/pygis
5553

5654
# ------------------------------
57-
# 5. Install geospatial from source
55+
# 5. Install pygis from source
5856
# ------------------------------
5957
# Prevent version resolution errors in CI
6058
ENV SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYGIS=0.0.0

0 commit comments

Comments
 (0)