Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nomiclabs/hardhat-docker

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nomiclabs/hardhat-docker

A library to manage Docker from Hardhat plugins

  • 2.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

npm hardhat

hardhat-docker

What

A library to manage Docker from Hardhat plugins.

Installation

npm install @nomiclabs/hardhat-docker

Usage

Importing HardhatDocker

const { HardhatDocker } = require("@nomiclabs/hardhat-docker");

Running Docker container

const image = { repository: "alpine", tag: "latest" };
const docker = await HardhatDocker.create();

if (!(await docker.hasPulledImage(image))) {
  await docker.pullImage(image);
}

const { statusCode, stdout, stderr } = await docker.runContainer(image, [
  "echo",
  "Hello world!",
]);

console.log(stdout.toString());

Available methods

MethodDescriptionArgumentsReturn Type
isInstalledcheck if docker is installedPromise<boolean>
imageExistscheck if docker image is available on docker hubImagePromise<boolean>
hasPulledImagecheck if docker image is pulledImagePromise<boolean>
isImageUpToDatecheck if latest docker image is installedImagePromise<boolean>
pullImagepulls docker image from docker hubImagePromise<void>
imageToRepoTagreturns image repository tagImageString
runContainerruns docker containerImage, commandPromise<ProcessResult>

Keywords

FAQs

Package last updated on 14 Oct 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc