{"id":21971295,"url":"https://github.com/eldada/docker-image-generator","last_synced_at":"2025-04-28T11:46:39.196Z","repository":{"id":114564328,"uuid":"175614145","full_name":"eldada/docker-image-generator","owner":"eldada","description":"Generate Docker images made of unique random binary layers with pre-set size","archived":false,"fork":false,"pushed_at":"2023-02-22T07:18:04.000Z","size":20,"stargazers_count":8,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T09:21:55.073Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eldada.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-14T12:07:02.000Z","updated_at":"2024-08-15T05:40:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"f92ef5fb-adfe-4af3-8b20-79fd5bf9825e","html_url":"https://github.com/eldada/docker-image-generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldada%2Fdocker-image-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldada%2Fdocker-image-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldada%2Fdocker-image-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldada%2Fdocker-image-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eldada","download_url":"https://codeload.github.com/eldada/docker-image-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251309352,"owners_count":21568798,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-29T14:49:56.218Z","updated_at":"2025-04-28T11:46:39.189Z","avatar_url":"https://github.com/eldada.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Images Generator\nGenerate uniquely named Docker images made up of unique layers with a given layer size and number of layers (`layer size` X `number of layers` = `image total size`) and upload them to a Docker registry.\n\nThe build and upload can run in parallel processes for increased load and saving time.\n\n## Use case\nI use this to upload unique Docker images and load test my [Artifactory](https://jfrog.com/artifactory/) instance, which is also my Docker registry.\n\n## Design\nThe generator runs locally using your installed Docker engine or in a Docker container (based on `docker:dind`), generating images using pre-defined parameters and then uploads to the set Docker registry.\n\n## Variables\nThe following environment variables are used to configure the execution\n\n|         Variable        |           Description                             |   Default                       |\n|-------------------------|---------------------------------------------------|---------------------------------|\n| `NUMBER_OF_IMAGES`      | Total number of unique Docker images to create    | `1`                             |\n| `NUMBER_OF_LAYERS`      | Number of layers per Docker image                 | `1`                             |\n| `SIZE_OF_LAYER_KB`      | Size in KB of each layer                          | `1`                             |\n| `NUM_OF_THREADS`        | Number of parallel processes to run               | `1`                             |\n| `TAG`                   | Generated Docker image tag                        | `1`                             |\n| `DOCKER_REGISTRY`       | The Docker registry to push the built images to   | (Must pass value or will fail)  |\n| `INSECURE_REGISTRY`     | Allow insecure registry connection                | `false`                         |\n| `DOCKER_USER`           | Docker registry username for `DOCKER_REGISTRY`    | `admin`                         |\n| `DOCKER_PASSWORD`       | Docker registry password for `DOCKER_REGISTRY`    | `password`                      |\n| `REPO_PATH`             | Path under `DOCKER_REGISTRY` to push images to    | `docker-auto`                   |\n| `REMOVE_IMAGES`         | Remove created images from host                   | `true`                          |\n| `DEBUG`                 | Provide debug output (shell set -x)               | ``                              |\n\n## Build Docker image\nBuild the generator Docker image\n```shell\nexport REGISTRY=\nexport REPOSITORY=\nexport IMAGE_TAG=\n\ndocker build -t ${REGISTRY}/${REPOSITORY}:${IMAGE_TAG} .\n```\n\n## Running Generator \n\n### Run In Local Shell\nYou can run the generator directly with your Docker engine\n1. Copy `env-template.sh` to `env.sh` (if not copied, it will be copied with its current values in the first run)\n2. Edit `env.sh` to adjust your configuration\n3. Run the script\n```shell\n./run-local.sh\n```\n\n### Run In A Docker container\nYou can run the Docker container directly on your Docker enabled host (needs the `--privileged` to work).\u003cbr\u003e\nYou can use the already built image `eldada.jfrog.io/docker/docker-data-generator:0.16`\n```shell\n# Example for creating 100 images with 10 layers 1MB each and uploading to docker.artifactory/test\n# in 3 parallel sub processes (the 100 images are slit between the processes).\nexport REGISTRY=eldada.jfrog.io/docker\nexport REPOSITORY=docker-data-generator\nexport IMAGE_TAG=0.16\n\nexport NUMBER_OF_IMAGES=100\nexport NUMBER_OF_LAYERS=10\nexport SIZE_OF_LAYER_KB=1024\nexport NUM_OF_THREADS=3\nexport TAG=1\nexport DOCKER_REGISTRY=docker.artifactory\nexport INSECURE_REGISTRY=true\nexport DOCKER_USER=${YOUR_DOCKER_USERNAME}\nexport DOCKER_PASSWORD=${YOUR_DOCKER_PASSWORD}\nexport REPO_PATH=test\nexport REMOVE_IMAGES=true\nexport DEBUG=\n\ndocker run --rm --name docker-data-gen \\\n    -e NUMBER_OF_IMAGES=${NUMBER_OF_IMAGES} \\\n    -e NUMBER_OF_LAYERS=${NUMBER_OF_LAYERS} \\\n    -e SIZE_OF_LAYER_KB=${SIZE_OF_LAYER_KB} \\\n    -e NUM_OF_THREADS=${NUM_OF_THREADS} \\\n    -e TAG=${TAG} \\\n    -e DOCKER_REGISTRY=${DOCKER_REGISTRY} \\\n    -e INSECURE_REGISTRY=${INSECURE_REGISTRY} \\\n    -e DOCKER_USER=${DOCKER_USER} \\\n    -e DOCKER_PASSWORD=${DOCKER_PASSWORD} \\\n    -e REPO_PATH=${REPO_PATH} \\\n    -e REMOVE_IMAGES=${REMOVE_IMAGES} \\\n    -e DEBUG=${DEBUG} \\\n    --privileged \\\n    ${REGISTRY}/${REPOSITORY}:${IMAGE_TAG}\n```\n\n### Run in Kubernetes with provided Helm chart\nIt's possible to deploy the Docker image generator with the helm chart in [docker-image-generator](docker-image-generator).\n\nIt's recommended to prepare a custom `values.yaml` file for each scenario with the custom `env` needed. See [values-example-1gb.yaml](docker-image-generator/values-example-1gb.yaml) as example.\n\n**IMPORTANT:** Be aware that the Job is set to run with `privileged: true`\n```\n...\n    securityContext:\n      privileged: true\n...\n```\n\n#### Deploy\n**IMPORTANT:** The Job deployed in K8s is not removed after completed, so you'll need to remove a deployed release before deploying again\n\nExample using the [values-example-1gb.yaml](docker-image-generator/values-example-1gb.yaml) as custom parameters\n```shell\n# Deploy\ncd docker-image-generator\nhelm install --upgrade data-gen -f values-example-1gb.yaml .\n\n# Remove once done\nhelm uninstall data-gen\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldada%2Fdocker-image-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feldada%2Fdocker-image-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldada%2Fdocker-image-generator/lists"}