Skip to content

Auto-Discovery

The autodocker plugin scans your project and automatically registers components. Let’s see how it works.

When EMB loads your project, the autodocker plugin:

  1. Scans all directories in your project root
  2. Looks for directories containing a Dockerfile
  3. Registers each as a component with default settings
  4. Creates a docker/image resource for building the image

Use the components command to see what EMB discovered:

Terminal window
emb components
COMPONENT NAME ID CREATED STATUS
--------------------------------------
api

EMB found our api component automatically.

To see exactly how EMB configured the component, use config print:

Terminal window
emb config print
components:
api:
rootDir: api
resources:
image:
type: docker/image
params: {}
defaults: {}
env: {}
flavors: {}
plugins:
- name: autodocker
project:
name: hello-world
tasks: {}
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!

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 arguments

The image will be tagged as {project-name}/{component-name}:latest, so our API image will be hello-world/api:latest.

Continue to First Commands to learn the essential EMB commands.