{"action":"created","issue":{"url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/1016","repository_url":"https://api.github.com/repos/testcontainers/testcontainers-java","labels_url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/1016/labels{/name}","comments_url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/1016/comments","events_url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/1016/events","html_url":"https://github.com/testcontainers/testcontainers-java/pull/1016","id":391492644,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM4OTgyMjg1","number":1016,"title":"Simplify GitLab CI documentation","user":{"login":"TjeuKayim","id":15987676,"node_id":"MDQ6VXNlcjE1OTg3Njc2","avatar_url":"https://avatars0.githubusercontent.com/u/15987676?v=4","gravatar_id":"","url":"https://api.github.com/users/TjeuKayim","html_url":"https://github.com/TjeuKayim","followers_url":"https://api.github.com/users/TjeuKayim/followers","following_url":"https://api.github.com/users/TjeuKayim/following{/other_user}","gists_url":"https://api.github.com/users/TjeuKayim/gists{/gist_id}","starred_url":"https://api.github.com/users/TjeuKayim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TjeuKayim/subscriptions","organizations_url":"https://api.github.com/users/TjeuKayim/orgs","repos_url":"https://api.github.com/users/TjeuKayim/repos","events_url":"https://api.github.com/users/TjeuKayim/events{/privacy}","received_events_url":"https://api.github.com/users/TjeuKayim/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-12-16T18:28:31Z","updated_at":"2018-12-20T16:56:49Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/testcontainers/testcontainers-java/pulls/1016","html_url":"https://github.com/testcontainers/testcontainers-java/pull/1016","diff_url":"https://github.com/testcontainers/testcontainers-java/pull/1016.diff","patch_url":"https://github.com/testcontainers/testcontainers-java/pull/1016.patch"},"body":"Last week, I spend some time figuring out the best configuration for GitLab CI and DinD. At first, I used the [example in the docs](https://www.testcontainers.org/ci/ci.html#gitlab). Then I tried other ways.\r\n\r\nAs it turns out, the documented GitLab configuration is over-complicated. It uses three containers (`docker:latest`, `gradle:3.4`, `docker:dind`) and runs docker in a script, but that extra layer is unnecessary. By setting the `DOCKER_HOST` environment variable, you only need two containers.\r\n\r\nFor example:\r\n```yml\r\n# we need DinD service\r\nservices:\r\n  - docker:dind\r\n\r\nvariables:\r\n  # to improve performance\r\n  DOCKER_DRIVER: overlay2\r\n  # connect testcontainers to DinD service\r\n  DOCKER_HOST: \"tcp://docker:2375\"\r\n\r\ntest:\r\n image: gradle:3.4\r\n stage: test\r\n script: ./gradlew test\r\n```\r\n\r\nThis configuration is more readable, and has better performance. That's why I suggest to update the documentation for using Gitlab CI.\r\n\r\n<details><summary>Complete <code>.gitlab-ci.yml</code> I used</summary>\r\n\r\n```yml\r\n.gradle: &gradle\r\n  image: openjdk:11\r\n  cache:\r\n    key: \"gradle-$CI_COMMIT_REF_NAME\"\r\n    paths:\r\n      - build\r\n      - .gradle\r\n  before_script:\r\n    - export GRADLE_USER_HOME=`pwd`/.gradle\r\n  variables:\r\n    GRADLE_OPTS: \"-Dorg.gradle.daemon=false\"\r\n\r\ngradle assemble:\r\n  stage: build\r\n  <<: *gradle\r\n  script: ./gradlew --build-cache assemble\r\n\r\ngradle check:\r\n  stage: test\r\n  <<: *gradle\r\n  variables:\r\n    DOCKER_HOST: \"tcp://docker:2375\"\r\n    DOCKER_DRIVER: overlay2\r\n  services:\r\n    - docker:dind\r\n  script: ./gradlew check\r\n  artifacts:\r\n    paths:\r\n      - build/test-results/test/TEST-*.xml\r\n    reports:\r\n      junit: build/test-results/test/TEST-*.xml\r\n\r\ndeploy backend:\r\n  stage: deploy\r\n  script: echo \"Hello World\"\r\n```\r\n</details>"},"comment":{"url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/comments/449065224","html_url":"https://github.com/testcontainers/testcontainers-java/pull/1016#issuecomment-449065224","issue_url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/1016","id":449065224,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0OTA2NTIyNA==","user":{"login":"kiview","id":5088104,"node_id":"MDQ6VXNlcjUwODgxMDQ=","avatar_url":"https://avatars0.githubusercontent.com/u/5088104?v=4","gravatar_id":"","url":"https://api.github.com/users/kiview","html_url":"https://github.com/kiview","followers_url":"https://api.github.com/users/kiview/followers","following_url":"https://api.github.com/users/kiview/following{/other_user}","gists_url":"https://api.github.com/users/kiview/gists{/gist_id}","starred_url":"https://api.github.com/users/kiview/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiview/subscriptions","organizations_url":"https://api.github.com/users/kiview/orgs","repos_url":"https://api.github.com/users/kiview/repos","events_url":"https://api.github.com/users/kiview/events{/privacy}","received_events_url":"https://api.github.com/users/kiview/received_events","type":"User","site_admin":false},"created_at":"2018-12-20T16:56:49Z","updated_at":"2018-12-20T16:56:49Z","author_association":"MEMBER","body":"Hey @TjeuKayim,\r\nthis looks pretty nice an is indeed much simpler.\r\n\r\nI'm normally just a Gitlab on-prem user, using Docker socket mounting, so I was never sure what's the best way to achieve this in Gitlab cloud. But I think your example is definitely nicer as the current one, so thanks."}}
{"actor":{"display_login":"kiview"}}