🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

@pulumi/docker

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
p

@pulumi/docker

A Pulumi package for interacting with Docker in Pulumi programs

4.6.2
latest
100

Supply Chain Security

100

Vulnerability

87

Quality

97

Maintenance

100

License

Version published
Weekly downloads
472K
-9.43%
Maintainers
0
Weekly downloads
 
Created
Issues
67

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

FAQs

Package last updated on 15 Mar 2025

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