Socket
Socket
Sign inDemoInstall

dockerignore

Package Overview
Dependencies
7
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    dockerignore

Command line tool for creating or updating a .dockerignore file based on .gitignore.


Version published
Weekly downloads
21
increased by50%
Maintainers
1
Install size
66.3 kB
Created
Weekly downloads
 

Readme

Source

dockerignore NPM version

Command line tool for creating or updating a .dockerignore file based on .gitignore.

Install globally with npm:

npm i -g dockerignore

Usage

Say .gitignore has:

node_modules
test/actual

And you want .dockerignore to have:

node_modules
test/actual
test/fixtures

In the command line run:

dockerignore "test/fixtures"

An .dockerignore file will be created, or updated:

node_modules
test/actual

# dockerignore
test/fixtures

Heads up!

The # dockerignore comment is used to ensure that .dockerignore reflects the latest changes in your .gitignore file, just by running dockerignore in the command line.

_If you want to preserve everything in your .dockerignore file, regardless of what is in .gitignore, just add the # dockerignore comment at the top of the .dockerignore file.

CLI commands

  • -i|--ignore: comma-separated list of patterns to add to .dockerignore
  • -u|--unignore: comma-separated list of patterns to remove from .dockerignore. This will not un-ignore patterns in .gitignore.
  • -D|--dest: optionally define a different destination filepath. Good for test driving to see what will be generated in advance.
  • -g|--gitignore: alternate source filepath for .gitignore.
  • -d|--dockerignore: alternate source filepath for .dockerignore.

API

To use via API, first:

npm i dockerignore --save

Then:

var dockerignore = require('dockerignore');
dockerignore(dock, git, options);

Params

  • dock {String|Array}: String from .dockerignore or an array of patterns to use.
  • git {String|Array}: String from .gitignore or an array of patterns to use.
  • options {Object}
    • ignore Array of patterns to add to the existing patterns from .gitignore
    • unignore Array of patterns to remove from .dockerignore. This will not un-ignore patterns in .gitignore

Run tests

Install dev dependencies.

npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Maintainer

James Talmage

Author of npmignore (of which this is a fork)

Jon Schlinkert

License

Original npmignore utility Copyright (c) 2015 Jon Schlinkert
Released under the MIT license


This file was generated by verb-cli on March 17, 2015.

FAQs

Last updated on 09 Jul 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc