Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/daniel-le97/docker-bun
Docker Api client for bun
https://github.com/daniel-le97/docker-bun
bun docker
Last synced: about 2 months ago
JSON representation
Docker Api client for bun
- Host: GitHub
- URL: https://github.com/daniel-le97/docker-bun
- Owner: daniel-le97
- License: mit
- Created: 2023-11-06T20:49:54.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-15T05:07:14.000Z (about 1 year ago)
- Last Synced: 2024-03-15T08:50:09.300Z (10 months ago)
- Topics: bun, docker
- Language: TypeScript
- Homepage:
- Size: 517 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# docker-bun
## Getting Started
I Probably would not use this yet as there will be breaking changes, and will be removed once bun provides support for socket paths in http clients
this project was made because no existing node docker packages work in bun
The docker Api specification was used to generate the API
API endpoints with steams do not yet work as i do not yet understand how all of buns api's work
most have a paramater that disables streamsTo install dependencies:
```bash
bun add docker-bun
```Usage
```js
import { Docker } from 'docker-bun'const docker = new Docker()
// orconst docker = new Docker(opts)
// get all containers
const containers = await docker.container.containerList()
```
# CaveatsThis uses bun to connect to dockers unix socket
other methods have not been sought out yet
Currently the only configuration is
```js
export interface OpenAPIConfig {
BASE: string
VERSION: string
WITH_CREDENTIALS: boolean
CREDENTIALS: 'include' | 'omit' | 'same-origin'
TOKEN?: string | Resolver | undefined
USERNAME?: string | Resolver | undefined
PASSWORD?: string | Resolver | undefined
HEADERS?: Headers | Resolver | undefined
ENCODE_PATH?: ((path: string) => string) | undefined
};export const OpenAPI: OpenAPIConfig = {
BASE: '/v1.43',
VERSION: '1.43',
WITH_CREDENTIALS: false,
CREDENTIALS: 'include',
TOKEN: undefined,
USERNAME: undefined,
PASSWORD: undefined,
HEADERS: undefined,
ENCODE_PATH: undefined,
}// new Docker(OpenAPI)
```