Security News
Internet Archive Hacked, 31 Million Record Compromised
The Internet Archive's "Wayback Machine" has been hacked and defaced, with 31 millions records compromised.
@pulumi/docker
Advanced tools
@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.
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;
dockerode is a Docker client for Node.js that allows you to interact with the Docker Remote API. It provides a more direct and lower-level interface to Docker compared to @pulumi/docker, which is more focused on infrastructure as code and higher-level abstractions.
node-docker-api is another Node.js client for the Docker Remote API. Similar to dockerode, it provides a low-level interface to Docker, allowing you to manage containers, images, networks, and more. It is less focused on infrastructure as code compared to @pulumi/docker.
docker-cli-js is a Node.js module that allows you to interact with Docker using the command line interface (CLI). It provides a way to run Docker commands from within a Node.js application. Unlike @pulumi/docker, it does not provide a high-level infrastructure as code approach.
The Docker resource provider for Pulumi lets you manage Docker resources in your cloud programs. To use this package, please install the Pulumi CLI first.
This package is available in many languages in the standard packaging formats.
To use from JavaScript or TypeScript in Node.js, install using either npm
:
$ npm install @pulumi/docker
or yarn
:
$ yarn add @pulumi/docker
To use from Python, install using pip
:
$ pip install pulumi_docker
To use from Go, use go get
to grab the latest version of the library
$ go get github.com/pulumi/pulumi-docker/sdk/v4
To use from .NET, install using dotnet add package
:
$ dotnet add package Pulumi.Docker
For further information, please visit the Docker provider docs or for detailed reference documentation, please visit the API docs.
FAQs
A Pulumi package for interacting with Docker in Pulumi programs
The npm package @pulumi/docker receives a total of 472,366 weekly downloads. As such, @pulumi/docker popularity was classified as popular.
We found that @pulumi/docker demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
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.
Security News
The Internet Archive's "Wayback Machine" has been hacked and defaced, with 31 millions records compromised.
Security News
TC39 is meeting in Tokyo this week and they have approved nearly a dozen proposals to advance to the next stages.
Security News
Our threat research team breaks down two malicious npm packages designed to exploit developer trust, steal your data, and destroy data on your machine.