sortapp/README.md

84 lines
2.3 KiB
Markdown
Raw Permalink Normal View History

2020-09-22 15:22:14 +02:00
# SortApp
2020-09-22 11:51:39 +02:00
2020-09-24 16:08:59 +02:00
SortApp is a simple example that allows you to sort a file in input.
2020-09-22 11:51:39 +02:00
Starting from this example, you can first create an installable package via pip3 and then a docker image in which it is installed the created package.
The package declares the sortapp command as entrypoint.
So once the package is installed you can use this command at command line to run the example:
2020-09-22 11:58:53 +02:00
```
sortapp <token> <file-item-id> <temp-dir-item-id>
```
2020-09-22 11:51:39 +02:00
The image created in this way can be executed in a container with the following command:
2020-09-22 11:58:53 +02:00
```
docker run -i -t --rm --name sortapp-cont sortapp sortapp <token> <file-item-id> <temp-dir-item-id>
```
2020-09-22 11:51:39 +02:00
2020-09-22 15:11:01 +02:00
To be able to create an image from this application you need to have Docker and Docker-Compose installed on your machine and the relative python packages, see:
[Docker](https://docs.docker.com/engine/),
[Docker-Compose](https://docs.docker.com/compose/install/) and
[Docker Package for Python](https://pypi.org/project/docker/).
2020-09-22 15:05:59 +02:00
2020-09-22 11:55:00 +02:00
## Useful Commands
2020-09-22 11:51:39 +02:00
2020-09-22 11:55:00 +02:00
### Create Distribution Package
2020-09-22 11:58:53 +02:00
```
2020-09-22 11:51:39 +02:00
python3 setup.py sdist --formats=gztar
2020-09-22 11:58:53 +02:00
```
2020-09-22 11:55:00 +02:00
### Create Docker Image
2020-09-22 11:58:53 +02:00
```
2020-09-22 11:51:39 +02:00
docker build -t sortapp .
2020-09-22 11:58:53 +02:00
```
2020-09-22 11:51:39 +02:00
2020-09-22 11:55:00 +02:00
### Save Docker Image in file
2020-09-22 11:58:53 +02:00
```
2020-09-22 11:51:39 +02:00
docker save sortapp | gzip > sortapp.tar.gz
2020-09-22 11:58:53 +02:00
```
2020-09-22 11:51:39 +02:00
2020-09-22 11:55:00 +02:00
### Publish Docker Image on DockerHub
2020-09-22 12:01:11 +02:00
Re-tagging an existing local image:
2020-09-22 11:58:53 +02:00
```
2020-09-22 12:01:11 +02:00
docker tag sortapp <hub-user>/<repo-name>[:<tag>]
```
2020-09-22 11:51:39 +02:00
Login in DockerHub(use your Docker ID):
2020-09-22 12:01:11 +02:00
```
docker login
```
2020-09-22 11:51:39 +02:00
Now you can push this repository to the registry designated by its name or tag:
2020-09-22 12:01:11 +02:00
```
docker push <hub-user>/<repo-name>:<tag>
```
2020-09-22 11:51:39 +02:00
Then logout for security:
2020-09-22 12:01:11 +02:00
```
docker logout
2020-10-16 17:37:44 +02:00
```
## Authors
* **Giancarlo Panichi** ([ORCID](http://orcid.org/0000-0001-8375-6644)) - [ISTI-CNR Infrascience Group](http://nemis.isti.cnr.it/groups/infrascience)
## License
This project is licensed under the EUPL V.1.1 License - see the [LICENSE.md](LICENSE.md) file for details.
## About the gCube Framework
This software is part of the [gCubeFramework](https://www.gcube-system.org/ "gCubeFramework"): an
open-source software toolkit used for building and operating Hybrid Data
Infrastructures enabling the dynamic deployment of Virtual Research Environments
by favouring the realisation of reuse oriented policies.
The projects leading to this software have received funding from a series of European Union programmes see [FUNDING.md](FUNDING.md)