@serverless/docker

Instantly build and push your Docker images with Serverless Components. Supports the configuration of the Docker Daemon as well as the Container Registry.

Usage no npm install needed!

<script type="module">
  import serverlessDocker from 'https://cdn.skypack.dev/@serverless/docker';
</script>

README

docker

Instantly build and push your Docker images with Serverless Components. Supports the configuration of the Docker Daemon as well as the Container Registry.

 

  1. Install
  2. Create
  3. Configure
  4. Deploy

 

1. Install

$ npm install -g serverless

2. Create

Just create a serverless.yml file

$ touch serverless.yml
# .env
DOCKER_USERNAME=XXX
DOCKER_PASSWORD=XXX

3. Configure

# serverless.yml

myImage:
  component: '@serverless/docker'
  inputs:
    dockerHost: '192.168.2.1' # default is `'127.0.0.1'`
    dockerPort: 4711 # default is `3000`
    dockerfile: my-app.dockerfile # default is `Dockerfile`
    context: '.' # default is `process.cwd()`
    registryAddress: 'https://container-registry.acme.com' # default is `'https://index.docker.io/v1'`
    push: true # default is `false`
    repository: acme/my-image
    tag: latest

4. Deploy

$ serverless

New to Components?

Checkout the Serverless Components repo for more information.