diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..ccff69f5 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,26 @@ +# Use the official Python 3.11 image from the Docker Hub +FROM python:3.11 + +# Update the system and install the packages +RUN apt-get update && apt-get install -y \ + git-lfs \ + openmpi-bin \ + openmpi-doc \ + libopenmpi-dev \ + gdal-bin \ + libgdal-dev + + +# Set the working directory to /app +WORKDIR /app + +# Copy the current directory contents into the container at /app +COPY . /app + +# Create the output directory +RUN mkdir -p /app/output + +# Install any needed packages specified in pyproject.toml +RUN pip install --editable ".[dev]" + +CMD ["/bin/bash"] \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..43a4a24b --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,26 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile +{ + "name": "Existing Dockerfile", + "build": { + // Sets the run context to one level up instead of the .devcontainer folder. + "context": "..", + // Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename. + "dockerfile": "Dockerfile" + } + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Uncomment the next line to run commands after the container is created. + // "postCreateCommand": "cat /etc/os-release", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "devcontainer" +} diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index dd0de0d7..00000000 --- a/Dockerfile +++ /dev/null @@ -1,48 +0,0 @@ -# Using the ubuntu:20.04 base image for compatibility with the ICESat-2 SlideRule software -# Some code to add conda from https://github.com/conda-forge/miniforge-images/blob/master/ubuntu/Dockerfile -# This file builds the docker image for the ICESat-2 tracks project. Includes the ICESat-2 SlideRule tool, conda, and the python3.11 environment for the project with dependencies provided in the environment_small.yml file. -FROM ubuntu:20.04 -ARG DEBIAN_FRONTEND=noninteractive -ARG MINIFORGE_NAME=Miniforge3 -ARG MINIFORGE_VERSION=23.3.1-0 -ARG TARGETPLATFORM - -ENV CONDA_DIR=/opt/conda -ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 -ENV PATH=${CONDA_DIR}/bin:${PATH} -ENV ENVNAME=2021-icesat2-tracks -RUN apt-get update && \ - apt-get install -y git curl wget - -# Install sliderule dependencies -RUN apt-get install -y build-essential libreadline-dev liblua5.3-dev zlib1g-dev cmake -RUN git clone https://github.com/ICESat2-SlideRule/sliderule.git -WORKDIR /sliderule/ -RUN make config && \ - make && \ - make install - -# Install conda -RUN apt-get update > /dev/null && \ - apt-get install --no-install-recommends --yes \ - bzip2 ca-certificates \ - tini \ - > /dev/null && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* && \ - wget --no-hsts --quiet https://github.com/conda-forge/miniforge/releases/download/${MINIFORGE_VERSION}/${MINIFORGE_NAME}-${MINIFORGE_VERSION}-Linux-$(uname -m).sh -O /tmp/miniforge.sh && \ - /bin/bash /tmp/miniforge.sh -b -p ${CONDA_DIR} && \ - rm /tmp/miniforge.sh && \ - conda clean --tarballs --index-cache --packages --yes && \ - find ${CONDA_DIR} -follow -type f -name '*.a' -delete && \ - find ${CONDA_DIR} -follow -type f -name '*.pyc' -delete && \ - conda clean --force-pkgs-dirs --all --yes && \ - echo ". ${CONDA_DIR}/etc/profile.d/conda.sh && conda activate base" >> /etc/skel/.bashrc && \ - echo ". ${CONDA_DIR}/etc/profile.d/conda.sh && conda activate base" >> ~/.bashrc - -# Install conda environment -COPY environment_small.yml /tmp/environment.yml -RUN mamba env create -f /tmp/environment.yml - -ENTRYPOINT ["tini", "--"] -CMD ["/bin/bash"]