Auto-Discovery
The autodocker plugin scans your project and automatically registers components. Let’s see how it works.
How Auto-Discovery Works
Section titled “How Auto-Discovery Works”When EMB loads your project, the autodocker plugin:
- Scans all directories in your project root
- Looks for directories containing a
Dockerfile - Registers each as a component with default settings
- Creates a
docker/imageresource for building the image
Viewing Discovered Components
Section titled “Viewing Discovered Components”Use the components command to see what EMB discovered:
emb components COMPONENT NAME ID CREATED STATUS-------------------------------------- apiEMB found our api component automatically.
Viewing the Full Configuration
Section titled “Viewing the Full Configuration”To see exactly how EMB configured the component, use config print:
emb config printcomponents: api: rootDir: api resources: image: type: docker/image params: {}defaults: {}env: {}flavors: {}plugins: - name: autodockerproject: name: hello-worldtasks: {}vars: {}Notice how EMB added the components section with all the details for building the API image - you didn’t have to write any of this!
The Generated Resource
Section titled “The Generated Resource”Each auto-discovered component gets a docker/image resource with these defaults:
resources: image: type: docker/image # Resource type # params: # Optional build parameters # target: ... # Dockerfile target stage # args: ... # Build argumentsThe image will be tagged as {project-name}/{component-name}:latest, so our API image will be hello-world/api:latest.
Next Step
Section titled “Next Step”Continue to First Commands to learn the essential EMB commands.