Skip to content

Instantly share code, notes, and snippets.

@anthonynorth
Created December 20, 2023 07:53
Show Gist options
  • Save anthonynorth/5b016f2161c9c6171fd06949c4e2f598 to your computer and use it in GitHub Desktop.
Save anthonynorth/5b016f2161c9c6171fd06949c4e2f598 to your computer and use it in GitHub Desktop.
proj dev container
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
{
"name": "proj",
"build": {
"dockerfile": "Dockerfile",
"context": "../",
"args": { "PROJ_VERSION": "6.3.1" }
},
"customizations": {
"vscode": {
"extensions": [
"REditorSupport.r",
"ms-vscode.cpptools-extension-pack",
"vadimcn.vscode-lldb"
]
}
},
"capAdd": ["SYS_PTRACE"]
}
FROM ghcr.io/r-lib/rig/r:latest
RUN Rscript -e 'pak::pkg_install(c("devtools", "languageserver"))'
ARG PROJ_VERSION=6.3.1
RUN apt-get -y update -y && \
apt-get -y install build-essential software-properties-common cmake \
libsqlite3-dev sqlite3 libtiff5-dev curl libcurl4-openssl-dev && \
curl -Ls https://download.osgeo.org/proj/proj-${PROJ_VERSION}.tar.gz | \
tar xz --strip-components=1 --one-top-level=/libproj && \
mkdir -p /libproj/build && \
cd /libproj/build && \
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF && \
cmake --build . --parallel $(nproc --all) && \
cmake --build . --target install
# install package deps
COPY DESCRIPTION .
RUN Rscript -e 'desc::desc_del("SystemRequirements")' && \
Rscript -e 'pak::local_install_dev_deps()' && \
rm DESCRIPTION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment