Skip to content

Building Images

EMB manages Docker image builds with automatic tagging based on your project configuration.

First, see what resources are available:

Terminal window
emb resources
ID NAME TYPE PUBLISHABLE REFERENCE
-----------------------------------------------------------------------
api:image image docker/image fullstack-app/api:latest
web:image image docker/image fullstack-app/web:latest

Each component has an image resource that can be built.

Build all images at once:

Terminal window
emb resources build

EMB will:

  1. Determine the build order (respecting dependencies)
  2. Build each image with appropriate tags
  3. Cache results to avoid rebuilding unchanged images

Build just one component:

Terminal window
emb resources build api

Or multiple:

Terminal window
emb resources build api web

Images are tagged using the pattern:

{project-name}/{component-name}:{tag}

For our project with DOCKER_TAG=latest:

  • fullstack-app/api:latest
  • fullstack-app/web:latest

After building, see your images:

Terminal window
emb images

Skip the cache and force a full rebuild:

Terminal window
emb resources build --force

See what would be built without actually building:

Terminal window
emb resources build --dry-run

Build logs are saved to .emb/default/logs/docker/build/. If a build fails, check the log for details.

Override the tag at build time:

Terminal window
DOCKER_TAG=v1.0.0 emb resources build

This builds with tag v1.0.0 instead of latest.

You’ve now learned the fullstack-app features:

  • Multiple components with Embfiles
  • Environment variables via dotenv plugin
  • Tasks at project and component levels
  • Docker Compose for running services
  • Image building with automatic tagging

Ready to learn about component dependencies? Continue to Microservices to explore:

  • Shared base images
  • Component dependencies
  • Build ordering