You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Serverless 1.x plugin to build your artifacts within docker container.
Installation and Usage
npm install --save serverless-docker-artifacts
Add the plugin to your serverless.yml file and configure:
plugins:
- serverless-docker-artifactscustom:
dockerArtifact:
path: '.'# Defaults to '.'dockerfile: Dockerfile-tesseract # Defaults to 'Dockerfile'args: # Pass args with --build-argTESSERACT_VERSION: 4.0.0TESSDATA: "osd eng rus"copy: tesseract-standalone # Not affected by path# If you have more than onedockerArtifacts:
- path: build/somelibcopy: somelib
- path: build/toolcopy: tool-portable
Then run sls deploy or sls package as usual.
Extra commands
This plugin defines commands to manufacture and clean artifacts without packaging them:
sls dockart create # Build all artifacts
SLS_DEBUG="*" sls dockart create # Same, showing all the process
sls dockart clean # Delete artifacts
sls dockart clean-docker # Delete docker images and containers
Note that if you are debugging a dockerfile you probaly have lots of dangling images and their containers. These are not removed by sls dockart clean-docker, you need to handle it yourself.
API for your plugins
constdockart=require('serverless-docker-artifacts');// Create an artifactdockart.createArtifact({path: 'path/to/',dockerfile: 'Dockerfile',args: {...},copy: 'some-dir',})// Remove containers and imagesdockart.cleanDocker()
About
A Serverless plugin to build your artifacts within docker container