Merge pull request #7 from nytimes/feature/update-documentation

Add Wiki and getting started guides
pull/10/head
Or Fleisher 2020-05-01 12:01:17 -04:00 zatwierdzone przez GitHub
commit d0c1b78b95
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 23 dodań i 19 usunięć

Wyświetl plik

@ -6,7 +6,7 @@
<img alt="License" src="https://img.shields.io/badge/License-Apache%202.0-yellow.svg" />
<a href="https://travis-ci.org/nytimes/rd-blender-docker"><img alt="Build status" src="https://travis-ci.org/nytimes/rd-blender-docker.svg?branch=master"></a><br/>
<a href="#getting-started">Getting Started</a> 📝
<a href="https://github.com/nytimes/rd-blender-docker/wiki">Wiki</a> 📝
<a href="#docker-tags">Docker tags</a> 🏷️
@ -16,15 +16,7 @@
</div>
## Getting started
The images in this repository are autogenerated by running the `generate.py` script. The script uses `manifest.json` image definitions to define different versions and capabilities.
### If you just want to use one of the images in your Dockerfile
It should look like something like
```docker
FROM nytimes/blender:latest
```
For all tags available see [Docker tags](#docker-tags) or visit the [Docker Hub repository](https://hub.docker.com/r/nytimes/blender)
> If you are running a GPU image make sure you [follow and setup Nvidia Container Toolkit](https://github.com/NVIDIA/nvidia-docker)
The images in this repository are autogenerated by running the `generate.py` script. The script uses `manifest.json` image definitions to define different versions and capabilities. To quickly get started with using the images head over to our [wiki page](https://github.com/nytimes/rd-blender-docker/wiki).
## Docker tags
- `nytimes/blender:latest` - Latest GPU image with latest Blender version
@ -42,6 +34,6 @@ For all tags available see [Docker tags](#docker-tags) or visit the [Docker Hub
To contribute a new image make sure you:
- Add the image definition in the `manifest.json`
- Add the image to this README in the [Docker tags](#docker-tags) section
- PR your change and if everything is builds we will deploy it Docker Hub
- PR your change and if the change is approved, we will deploy it Docker Hub
> This repository is maintained by the Research & Development team at The New York Times and is provided as-is for your own use. For more information about R&D at the Times visit [rd.nytimes.com](https://rd.nytimes.com)

Wyświetl plik

@ -6,6 +6,7 @@ Written by juniorxsound <https://orfleisher.com>
import os
import json
import shutil
import subprocess
if __name__ == "__main__":
@ -19,12 +20,23 @@ if __name__ == "__main__":
for image in manifest["images"]:
# Check if folder exists first
if (os.path.exists(output_folder + image["tag"])):
print('----------------------------------------------------------')
if os.path.exists(output_folder + image["tag"]):
print("----------------------------------------------------------")
print("🛠️ Building image nytimes/blender:{}".format(image["tag"]))
# Build the Docker image
os.system(
"docker build -q ./ -f {}/Dockerfile -t nytimes/blender:{}".format(
output_folder + image["tag"], image["tag"]
)
)
# Copy the README from root so it deploys to DockerHub
if os.getenv("CI") != None:
print("Copying README to Dockerfile folder on CI so it deploys to Docker Hub\n")
shutil.copy2("./README.md", output_folder + image["tag"])
print(
'🛠️ Building image nytimes/blender:{}'.format(image["tag"]))
os.system('docker build --quiet ./ -f {}/Dockerfile -t nytimes/blender:{}'.format(
output_folder + image["tag"], image["tag"]))
print(
'✔️ Built and tagged image nytimes/blender:{}'.format(image["tag"]))
print('----------------------------------------------------------\n')
"✔️ Built and tagged image nytimes/blender:{}".format(image["tag"])
)
print("----------------------------------------------------------\n")