Skip to content

marcoberger/docker-xarray

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dockerized xarray sample

This sample show how to execute a python script, which uses the xarray library within a simple docker container.

Prerequesites

  • Docker install with version 20.0 or above

Clone repository

  1. Install git on your computer
  2. Clone repository: $ git clone https://github.com/marcoberger/docker-xarray.git

Run docker container plus sctipt

Steps to start the container and execute script:

  1. start docker deamon or start Docker desktop application
  2. run commands:
cd ${PROJECT_ROOT_FOLDER}
docker-compose up

Check the console output for hello123, which is echoed by the python script.

Included files in the project

  • geodata/test.txt: The geo-data file to be read from a docker volume. The folder geodata/ is mounted as volume /mygeodata in docker image. See docker-compose.yml on line 6.
  • src/script.py: The python script that is run in the container. See ENTRYPOINT on line 12 in Dockerfile
  • requirements.txt: Requirements to be installed in the docker image. See lines 5-8 in Dockerfile
  • Dockerfile: Describes how the docker image is built. Only happens once - not for each execution of the container.
  • docker-compose.yml: Comfort docker tool to start the container and mount the volume.

About

This sample show how to execute a python script, which uses the xarray library within a simple docker container.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors