You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@pulumi/docker

Package Overview
Dependencies
Maintainers
2
Versions
718
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pulumi/docker

A Pulumi package for interacting with Docker in Pulumi programs

3.1.0
Source
npmnpm
Version published
Weekly downloads
471K
6.62%
Maintainers
2
Weekly downloads
 
Created

What is @pulumi/docker?

@pulumi/docker is an npm package that allows you to manage Docker resources using Pulumi, a modern infrastructure as code platform. With this package, you can define, deploy, and manage Docker containers, images, and networks programmatically using JavaScript, TypeScript, or other supported languages.

What are @pulumi/docker's main functionalities?

Building Docker Images

This feature allows you to build Docker images from a specified directory. The code sample demonstrates how to build an image from the './app' directory and tag it as 'my-repo/my-image:latest'.

const pulumi = require('@pulumi/pulumi');
const docker = require('@pulumi/docker');

const image = new docker.Image('my-image', {
  build: './app',
  imageName: 'my-repo/my-image:latest',
});

exports.imageName = image.imageName;

Running Docker Containers

This feature allows you to run Docker containers. The code sample demonstrates how to run a container from the 'my-repo/my-image:latest' image and map port 80 inside the container to port 8080 on the host.

const pulumi = require('@pulumi/pulumi');
const docker = require('@pulumi/docker');

const container = new docker.Container('my-container', {
  image: 'my-repo/my-image:latest',
  ports: [{ internal: 80, external: 8080 }],
});

exports.containerId = container.id;

Managing Docker Networks

This feature allows you to create and manage Docker networks. The code sample demonstrates how to create a custom Docker network named 'my-custom-network'.

const pulumi = require('@pulumi/pulumi');
const docker = require('@pulumi/docker');

const network = new docker.Network('my-network', {
  name: 'my-custom-network',
});

exports.networkName = network.name;

Other packages similar to @pulumi/docker

Keywords

pulumi

FAQs

Package last updated on 01 Sep 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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.