0.3.0 • Published 5 years ago

@serverless/docker-image v0.3.0

Weekly downloads
9
License
Apache
Repository
-
Last release
5 years ago

docker-image

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-image'
  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.