azukiapp / azk

azk is a lightweight open source development environment orchestration tool. Instantly & safely run any environment on your local machine.
http://azk.io
Apache License 2.0
898 stars 63 forks source link

Container can't use the azk DNS #648

Open ReeSilva opened 8 years ago

ReeSilva commented 8 years ago

When I try to connect a dependent container to the container that it depends, it can't using the net.host, it fails. If I try with the IP of container it works, and also works with the IP of host.

Reproduce: a. Clone the azkdemo project b. Follow the steps to connect with Redis c. Try restart

Output

captura de tela de 2016-04-03 15-28-33

Info a. Fedora 23 b. Not using VirtualBox c.

/**
 * Documentation: http://docs.azk.io/Azkfile.js
 */
// Adds the systems that shape your system
systems({
  azkdemo: {
    // Dependent systems
    depends: ["redis"],
    // More images:  http://images.azk.io
    image: {"docker": "azukiapp/node"},
    // Steps to execute before running instances
    provision: [
      "npm install",
    ],
    workdir: "/azk/#{manifest.dir}",
    shell: "/bin/bash",
    command: ["npm", "start"],
    wait: 20,
    mounts: {
      '/azk/#{manifest.dir}': sync("."),
      '/azk/#{manifest.dir}/node_modules': persistent("./node_modules"),
    },
    scalable: {"default": 1},
    http: {
      domains: [ "#{system.name}.#{azk.default_domain}" ]
    },
    ports: {
      // exports global variables
      http: "3000/tcp",
    },
    envs: {
      // Make sure that the PORT value is the same as the one
      // in ports/http below, and that it's also the same
      // if you're setting it in a .env file
      NODE_ENV: "dev",
      PORT: "3000",
    },
  },
  redis: {
    image: {docker: "redis"},
    export_envs: {
      "DATABASE_URL": "redis://#{net.host}:#{net.port[6379]}",
    },
  },
});
ReeSilva commented 8 years ago

Hey guys, nothing about it?

gullitmiranda commented 8 years ago

hi @ReeSilva. this can be a problem with the dns resolver or redis connection.

$ azk agent start
$ dig dev.azk.io
ReeSilva commented 8 years ago

@gullitmiranda Hey guy, thanks for ur answer. Yeah, I'm using the DATABASE_URL, the application that I use to describe the error was the azkdemo application. When I dig both from host and other containers the result is the same. But, when I telnet the port of the redis container (in that run, 32770), it fails on container but works on host (as you can see on the image above) captura de tela de 2016-05-03 16-33-26

gullitmiranda commented 8 years ago

so the problem is in dns-resolver. you could send this message in the chat (https://gitter.im/azukiapp/azk) so that we can have an more quickly interaction?

ReeSilva commented 8 years ago

Sure, I'll do that