humbertovarona/geodata
This Docker images include netcdf-bin, nco, cdo, and hdf5-tools.
22
This Dockerfile sets up an Ubuntu-based environment with various scientific tools installed, including mc
, nano
, netcdf-bin
, nco
, cdo
, hdf5-tools
, and udunits-bin
. It also creates a specific user (sciuser
) and prepares a working directory with volume support for output management.
1.0
2024-08-30
The Dockerfile uses the ubuntu:noble
base image and installs a range of useful tools for scientific data manipulation and visualization.
mc
: Midnight Commander (file manager).nano
: Simple text editor.netcdf-bin
: Tools for reading and writing NetCDF files.nco
: NetCDF Operators (tools for manipulating NetCDF files).cdo
: Climate Data Operators.hdf5-tools
: Tools for working with HDF5 files.udunits-bin
: Unit conversion tools./home/sciuser/WORKDIR
: The working directory for the user sciuser
inside the container./home/sciuser/OUTPUT
: The output directory inside the container.A user sciuser
is created within the container, and ownership of the /home/sciuser/WORKDIR
directory is given to this user. The user is set to operate within this directory when the container starts.
To build the Docker image from the provided Dockerfile
, navigate to the directory containing the Dockerfile and run:
docker build -t geodata .
This will create an image named geodata
.
docker pull humbertovarona/geodata:v1
or
docker pull humbertovarona/geodata:latest
To run the container with a mounted volume from your local machine, execute the following command from your local terminal:
Example 1:
docker run -it -v $(pwd)/:/home/sciuser/ -v $(pwd)/OUTPUT:/home/sciuser/OUTPUT geodata cdo sinfo /home/sciuser/sst.oisst.mon.ltm.1991-2020.nc
Example 2:
docker run -it -v $(pwd)/:/home/sciuser/ -v $(pwd)/OUTPUT:/home/sciuser/OUTPUT geodata cdo ymonmean /home/sciuser/sst.oisst.mon.ltm.1991-2020.nc /home/sciuser/OUTPUT/mmClim.nc
Example 3:
docker run -it -v $(pwd)/:/home/sciuser/ -v $(pwd)/OUTPUT:/home/sciuser/OUTPUT geodata ncdump -h /home/sciuser/sst.oisst.mon.ltm.1991-2020.nc
Replace /path/to/local/output
with the path to the directory on your local machine where you want the container to store output files.
This command:
-it
)./path/to/local/output
) to the container's /home/sciuser/OUTPUT
directory using the -v
flag.The container starts with the default command bash
, placing you in an interactive shell as the user sciuser
.
Once inside the container's shell, the following tools are available for use:
nco
(NetCDF Operators): Manipulate and analyze NetCDF files. Example usage:ncks -h input_file.nc
cdo
(Climate Data Operators): Process climate and meteorological data. Example usage:cdo info input_file.nc
h5dump
: View the contents of HDF5 files. Example usage:h5dump file.h5
To exit the container's interactive shell, simply type exit
and press Enter
.
To remove the container after use, first find the container ID or name:
docker ps -a
Then remove it with:
docker rm <container_id>
/home/sciuser/WORKDIR
is the main working directory where the user sciuser
operates./home/sciuser/OUTPUT
directory is a volume. By using the -v
flag when running the container, you can map this directory to a local folder on the host machine, allowing for the output to be stored and accessed on the host.This setup ensures that data and results generated inside the container can be easily accessed from the host machine.
This Docker container is designed for scientific data manipulation, providing a pre-installed set of tools and a structured working environment. The setup includes a dedicated user and volume for output management, facilitating easy interaction between the container and the host machine.
If you wish to contribute to this project, please open an issue or submit a pull request on GitHub. Contributions to enhance the functionality or fix issues are always welcome.
This project is licensed under the MIT License. Feel free to use and modify the code as per the terms of the license.
docker pull humbertovarona/geodata