Coder Social home page Coder Social logo

denocker's People

Contributors

modprog avatar noxan avatar oursin avatar wolfgangvc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

denocker's Issues

--isolatedModules Flag causes error

In denoland/deno#8050 (issue 7326, the flag --isolatedModules was integrated.
This causes the following error when running denocker without supplying a tsconfig reversing that change:

error: TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
  ListContainer,
  ~~~~~~~~~~~~~
    at https://deno.land/x/[email protected]/types.ts:211:3

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
  Port,
  ~~~~
    at https://deno.land/x/[email protected]/types.ts:212:3

Found 2 errors.

The workaround is the creating a tsconfig:

{
  "compilerOptions": {
    "importsNotUsedAsValues": "remove",
    "isolatedModules": false
  }
}

But this should be fixed to make denocker compatible with the default settings of deno.

Does not appear to work with deno 1.7.2 and docker API 1.41

I'm trying to use this on MacOS (10.14.6) and the following code logs an empty array:

// index.ts
import Docker from "https://github.com/Oursin/denocker/raw/main/index.ts";

const docker = new Docker("/var/run/docker.sock");

const containers = await docker.containers.list({ all: true });

console.log(containers);
# terminal
$ deno run --unstable --allow-all index.ts
> []

Strangely, creating a container using the following works as expected :

const container = await docker.containers.create("my_container", {
  Image: "alpine",
  Cmd: ["ls"],
  StopTimeout: 10,
});

Note: I'm currently using main to work around #2

Add README

Looks like that could be a good library, some documentation would be nice.

Problem with first step to create container

Hello, for begin thanks a lot for your project.

I have an issue when I try to use it for create a container.

The container.ID is always "undefined".

Source :

import Docker from "https://deno.land/x/denocker/index.ts"

console.log("Docker socket")
const docker = new Docker("/var/run/docker.sock");

console.log("Docker create")
const container = await docker.containers.create("my_container", {
    Image: "alpine",
    Cmd: ["ls"],
});
console.log("Container Id : "+container.Id)

Result :

Download https://deno.land/x/denocker/index.ts
Warning Implicitly using latest version (v0.2.0) for https://deno.land/x/denocker/index.ts
Download https://deno.land/x/[email protected]/index.ts
Download https://deno.land/x/[email protected]/client/auth.ts
Download https://deno.land/x/[email protected]/container.ts
Download https://deno.land/x/[email protected]/client/client.ts
Download https://deno.land/x/[email protected]/types.ts
Download https://deno.land/x/[email protected]/client/httpClient.ts
Download https://deno.land/x/base64/mod.ts
Warning Implicitly using latest version (v0.2.1) for https://deno.land/x/base64/mod.ts
Download https://deno.land/x/[email protected]/mod.ts
Download https://deno.land/x/[email protected]/base.ts
Check file:///core/main.ts
Docker socket
Docker create
Container Id : undefined

Thanks a lot !

Listing all containers hangs

Problem reproduction

In one terminal:

docker run --rm -ti ubuntu sleep 30

Then run this script:

import Docker from "https://deno.land/x/denocker/index.ts"

const docker = new Docker("/var/run/docker.sock");
const containers = await docker.containers.list({all: false})
console.log('containers', containers);
   deno run -A --unstable dockerode-test.ts

returns:

containers []

However, changing docker.containers.list({all: false}) to docker.containers.list({all: true}) causes the process to hang indefinitely.

Do I have too many not-running containers?

docker ps -a | wc -l

returns 33 so no, not that many.

Environment

OS: macos 12.6
Docker: version 20.10.21, build baeda1f
Deno: 1.29.1 (release, x86_64-apple-darwin)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.