{"action":"created","issue":{"url":"https://api.github.com/repos/whisklabs/docker-it-scala/issues/3","repository_url":"https://api.github.com/repos/whisklabs/docker-it-scala","labels_url":"https://api.github.com/repos/whisklabs/docker-it-scala/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/whisklabs/docker-it-scala/issues/3/comments","events_url":"https://api.github.com/repos/whisklabs/docker-it-scala/issues/3/events","html_url":"https://github.com/whisklabs/docker-it-scala/issues/3","id":91796815,"number":3,"title":"overriding implicit val docker","user":{"login":"UriShohet","id":7903660,"avatar_url":"https://avatars.githubusercontent.com/u/7903660?v=3","gravatar_id":"","url":"https://api.github.com/users/UriShohet","html_url":"https://github.com/UriShohet","followers_url":"https://api.github.com/users/UriShohet/followers","following_url":"https://api.github.com/users/UriShohet/following{/other_user}","gists_url":"https://api.github.com/users/UriShohet/gists{/gist_id}","starred_url":"https://api.github.com/users/UriShohet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UriShohet/subscriptions","organizations_url":"https://api.github.com/users/UriShohet/orgs","repos_url":"https://api.github.com/users/UriShohet/repos","events_url":"https://api.github.com/users/UriShohet/events{/privacy}","received_events_url":"https://api.github.com/users/UriShohet/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2015-06-29T12:56:55Z","updated_at":"2016-07-12T17:28:19Z","closed_at":"2016-07-12T17:28:19Z","body":"Hi,\r\nI'm trying to use your code for our project and I'm having trouble overriding the implicit val docker from trait DockerKit.\r\n\r\nThe thing is that we use our own server - http://mydockerrepo:4243 - and the tests work fine only when I run sbt with \"export DOCKER_HOST=http://mydockerrepo:4243\". In order to avoid this I tried to override it as follows:\r\n```scala\r\nclass BackendITest extends FlatSpec with Matchers with BeforeAndAfterAll with GivenWhenThen with ScalaFutures with MyDockerCassandraService with DockerTestKit {\r\n  implicit lazy val pc = PatienceConfig(\r\n      timeout = scaled(Span(30, Seconds)),\r\n      interval = scaled(Span(150, Millis))\r\n    )\r\n\r\n  override implicit val docker: Docker = {\r\n    val dockerClientConfig = DockerClientConfig.\r\n      createDefaultConfigBuilder().\r\n      withUri(\"http://mydockerrepo:4243\").\r\n      build()\r\n    new Docker(dockerClientConfig)\r\n  }\r\n \r\n  \"cassandra container\" should \"be ready\" in {\r\n    cassandraContainer.isReady().futureValue shouldBe true\r\n  }\r\n}\r\n```\r\n\r\nBut then I get NullPointerException in DockerContainerOps.getLogs - docker is null.\r\n\r\nAm I doing something wrong?\r\nThanks in advance for your assistance.\r\nUri"},"comment":{"url":"https://api.github.com/repos/whisklabs/docker-it-scala/issues/comments/232118208","html_url":"https://github.com/whisklabs/docker-it-scala/issues/3#issuecomment-232118208","issue_url":"https://api.github.com/repos/whisklabs/docker-it-scala/issues/3","id":232118208,"user":{"login":"viktortnk","id":320239,"avatar_url":"https://avatars.githubusercontent.com/u/320239?v=3","gravatar_id":"","url":"https://api.github.com/users/viktortnk","html_url":"https://github.com/viktortnk","followers_url":"https://api.github.com/users/viktortnk/followers","following_url":"https://api.github.com/users/viktortnk/following{/other_user}","gists_url":"https://api.github.com/users/viktortnk/gists{/gist_id}","starred_url":"https://api.github.com/users/viktortnk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viktortnk/subscriptions","organizations_url":"https://api.github.com/users/viktortnk/orgs","repos_url":"https://api.github.com/users/viktortnk/repos","events_url":"https://api.github.com/users/viktortnk/events{/privacy}","received_events_url":"https://api.github.com/users/viktortnk/received_events","type":"User","site_admin":false},"created_at":"2016-07-12T17:28:19Z","updated_at":"2016-07-12T17:28:19Z","body":"There was no updates for this issue. Before closing it, I'll just leave an example of how we overriding it\r\n\r\n```\r\npackage whisk.docker.services\r\n\r\nimport com.github.dockerjava.core.DockerClientConfig\r\nimport com.github.dockerjava.jaxrs.DockerCmdExecFactoryImpl\r\nimport com.whisk.docker.{Docker, DockerKit}\r\n\r\ntrait DockerKitBase extends DockerKit {\r\n  override implicit val docker: Docker =\r\n    new Docker(\r\n      DockerClientConfig.createDefaultConfigBuilder().build(),\r\n      new DockerCmdExecFactoryImpl())\r\n}\r\n```"}}
{"actor":{"display_login":"viktortnk"}}