cs generate docker
Generated from CS CLI version v1.55.0.
Generates docker artifacts based on a ci.yml of a workspace
Synopsis
The generated artifacts will be saved in the output folder (default is ./export). It then generates following artifacts inside the output folder:
./
Codesphere recommends adding the generated artifacts to the source code repository.
Limitations:
- Environment variables have to be set explicitly as the Codesphere environment has its own way to provide env variables.
- The workspace ID, team ID etc. are not automatically available and have to be set explicitly.
- Hardcoded workspace urls don't work outside of the Codesphere environment.
- Each dockerfile of your services contain all prepare steps. To have the smallest image possible you would have to delete all unused steps in each service.
cs generate docker [flags]
Examples
# Generate docker for workspace 1234
$ cs generate docker -w 1234
# Generate docker for workspace 1234 based on ci profile ci.prod.yml
$ cs generate docker -w 1234 -i ci.prod.yml
Options
-b, --baseimage string Base image for the docker
-e, --env stringArray Env vars to put into generated artifacts
-h, --help help for docker
Options inherited from parent commands
-a, --api string URL of Codesphere API (can also be CS_API)
--branch string Branch of the repository to clone if the input file is not found (default "main")
-f, --force Overwrite any files if existing
-i, --input string CI profile to use as input for generation, relative to repository root (default "ci.yml")
-g, --org string Organization ID (relevant for some commands)
-o, --output string Output path of the folder including generated artifacts, relative to repository root (default "export")
--reporoot string root directory of the workspace repository to export. Will be used to clone the repository if it doesn't exist. (default "./workspace-repo")
-t, --team int Team ID (relevant for some commands, can also be CS_TEAM_ID) (default -1)
-v, --verbose Verbose output
-w, --workspace int Workspace ID (relevant for some commands, can also be CS_WORKSPACE_ID) (default -1)
SEE ALSO
- cs generate - Generate codesphere artifacts