Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Create Docker Container

ASecurity

Add a Docker container to a Datagrok package with Dockerfile and config

72 stars
0 votes
0 copies
1 views
Added 9/12/2026
devopstypescriptpythongoshelldockerapi

Works with

cliapi

Security Analysis

A100/100

Scanned 9/12/2026

Install to Claude Code

$npx -y skills add datagrok-ai/public --skill create-docker-container --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Create Docker Container?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Create Docker Container
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/datagrok-ai-create-docker-container/badge)](https://www.skillsdirectory.com/skills/datagrok-ai-create-docker-container)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: create-docker-container
description: Add a Docker container to a Datagrok package with Dockerfile and config
when-to-use: When user asks to add a Docker container, create a Dockerfile, or add server-side processing
effort: medium
---

# Create Docker Container

Help the user add a Docker container to their Datagrok package so it can be built, deployed, and accessed via the platform.

## Usage
```
/create-docker-container [package-name]
```

## Instructions

Follow these steps to create a Docker container for a Datagrok package:

### 1. Create the Dockerfile

Create a `dockerfiles/` folder inside the package root and add a `Dockerfile` there.

- The container MUST expose exactly one port using `EXPOSE $PORT` (only one EXPOSE is allowed).
- The application inside the container MUST embed an HTTP server listening on that port.
- Follow Docker best practices: minimal base images, multi-stage builds, small layers.

Example structure:
```
packages/MyPackage/
  dockerfiles/
    Dockerfile
    container.json   (optional)
  src/
  package.json
```

### 2. Create container.json (optional)

Place `container.json` in the same directory as the `Dockerfile`. If omitted, defaults are used.

```json
{
  "cpu": 1.5,
  "gpu": 1,
  "memory": 2048,
  "on_demand": true,
  "shutdown_timeout": 60,
  "storage": 25,
  "env": {
    "CONN": "#{x.Package:Entity}",
    "LOGIN": "login"
  }
}
```

Configuration properties and defaults:

| Property           | Type    | Default | Description                                              |
|--------------------|---------|---------|----------------------------------------------------------|
| cpu                | Double  | 0.25    | CPU cores allocated                                      |
| gpu                | Integer | 0       | GPU devices reserved                                     |
| memory             | Integer | 512     | RAM in megabytes                                         |
| on_demand          | Boolean | false   | Start container only on first request                    |
| shutdown_timeout   | Integer | null    | Idle minutes before auto-shutdown                        |
| storage            | Integer | 21      | Disk storage in gigabytes                                |
| shm_size           | Integer | 64      | Shared memory in megabytes                               |
| env                | Object  |         | Environment variables passed to the container            |
| image              | String  |         | Published image to run instead of building one           |
| port               | Integer |         | Port the container listens on (EXPOSE when built here)   |

Set `image` when the image is already published — built by a CI pipeline, kept in another
repository, or a stock third-party image. The folder then needs no Dockerfile at all, and
`grok publish` builds and pushes nothing:

```json
{
  "image": "datagrok/jkg_python:bleeding-edge",
  "port": 8888,
  "on_demand": true
}
```

Set `port` alongside it — with no Dockerfile there is no `EXPOSE` to read. A folder holding
both a Dockerfile and an `image` is built from the Dockerfile.

For env values, use `#{x.Package:Entity}` to pass a JSON-serialized entity from a package namespace. Credentials are only passed for connections within the same package.

### 3. Implement HTTP request access

Get the container ID and use `fetchProxy` to call the container's HTTP server:

```typescript
const containerId = (await grok.dapi.docker.dockerContainers.filter('my-container').first()).id;

const params = {
  method: 'POST',
  headers: {'Accept': 'application/json', 'Content-Type': 'application/json'},
  body: JSON.stringify(payload),
};
const response: Response = await grok.dapi.docker.dockerContainers.fetchProxy(containerId, '/endpoint', params);
const result = await response.json();
```

The `params` object follows the standard [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit) interface.

### 4. Implement WebSocket access (if needed)

```typescript
const ws: WebSocket = await grok.dapi.docker.dockerContainers.webSocketProxy(container.id, '/ws');
ws.send('Hello');

ws.addEventListener('message', (event: MessageEvent) => {
  console.log(event.data);
});

setTimeout(() => ws.close(), 3000);
```

### 5. Build and publish

```shell
webpack
grok publish dev
```

A return code of 0 indicates successful deployment. After publishing, Datagrok queues the image for building automatically.

### 6. Monitor status

In Datagrok, go to Platform -> Dockers to view containers and images. Status indicators:
- Green dot: running/ready
- Red dot: error
- Blinking grey dot: pending (starting, stopping, or rebuilding)
- No dot: stopped

Right-click a card to start/stop containers or rebuild images. Check logs via the Property pane.

## Behavior

- Ask the user for the package name and what service the container will run.
- Create the `dockerfiles/` directory, `Dockerfile`, and optionally `container.json`.
- If the user needs HTTP access, generate a TypeScript helper function using `fetchProxy`.
- If the user needs WebSocket access, generate a helper using `webSocketProxy`.
- Remind the user that only one `EXPOSE` port is allowed in the Dockerfile.
- Remind the user that `grok-spawner` must be running in the same environment.
- Follow project coding conventions: no excessive comments, prefer for-in loops, catch/else if on new lines.

Attribution

datagrok-aidatagrok-ai
View sourceMore from datagrok-ai →
SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Related Skills

Terraform Module Library

Build reusable Terraform modules for AWS, Azure, and GCP infrastructure following infrastructure-as-code best practices. Use when creating infrastructure modules, standardizing cloud provisioning, or implementing reusable IaC components.

393431 votes

sematext-otel

Wire a service's OpenTelemetry output to Sematext Cloud. Walks through region, App-type, instrumentation flow (managed OTLP endpoint vs Sematext Agent), and signal selection (traces/metrics/logs), then produces the exact env-var block and points at a runnable reference example in this repo. Invoke when instrumenting a new app for Sematext.

01 votes

Deployment Patterns

Deployment workflows, CI/CD pipeline patterns, Docker containerization, health checks, rollback strategies, and production readiness checklists for web applications. Use when setting up deployment infrastructure or planning releases.

2459130 votes

Babysit

Watch a pull request or review cycle until it is ready to merge. Use when asked to babysit, monitor, or keep checking PR comments, reviews, and CI until all actionable issues are resolved.

929660 votes

V7 Roster

Interact with the Paperclip control plane API for task coordination and governance. Use when checking assignments, updating issue status, posting comments, delegating work, managing routines, or calling Paperclip API endpoints.

798220 votes
View all in devops →