21

Unverified as it sounds brittle to me to start a container outside of k8s supervision, but you should be able to mount /var/run/docker.sock with a hostPath volume. Example variation from the documentation: apiVersion: v1 kind: Pod metadata: name: test-pd spec: containers: - image: gcr.io/google_containers/test-webserver name: test-container ...


17

Continuous Integration Concerns In short: Docker in Docker (dind) doesn't handle concurrency well. The reason why you shouldn't use dind for CI is because Docker was designed to have exclusive access to the directory it uses for storage (normally /var/lib/docker). Dind doesn't respect this as all child processes use this directory concurrently. Every time ...


8

I might have skipped the optional installation of docker in my Ubuntu instance, so if the gitlab runner is going to use Docker, remember to install it: curl -sSL https://get.docker.com/ | sh I got back to this issue and seem to have partially fixed it by checking it the gitlab runner is running gitlab-runner status systemctl is-enabled gitlab-runner ...


5

To avoid relying on dind (out of building new images from a dockerfile which should be ok) I'd look around Jenkins's kubernetes plugin. It obviously needs to bring to life a kubernetes cluster but allow to have a one time jenkins agent to run the test in a clean isolated environment, and then tear it off. The maintenance costs of the kubernetes cluster ...


4

After some research i found out that shared runners are good for the projects that are very much the same, and specific runners are better for the projects that are not like any project. Shared runners can eat all resources available in the end with its queue's which makes specific runners more interesting. My choice now is more like a little bit of both, ...


3

Caching of layers with buildkit in an external registry requires an extra step or two depending on how you want to cache your layers. The easy option is to include a build arg that enables the inline cache: docker build --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from ${LATEST} -t ${LATEST} -t ${IMAGE_COMMIT_TAG} . Note that the inline cache only caches ...


2

Although this is a working solution (I use it myself), there some drawbacks for running Docker in a Kubernetes pod by mounting /var/run/docker.sock Mostly the fact you are working with Docker containers outside the control of Kubernetes. Another suggested solution I found is using a side-car container in your pod. See A Case for Docker-in-Docker on ...


1

So if we change it for one service, we need to update it in each docker-compose.yml in each project. That's sounds like duplicate code and there are many ways to avoid that. But without more detailed information about how your setup looks like it's difficult to help. Within a pipeline you can access other projects and their source code. Maybe Git ...


1

I want to share the solution! just add image = docker:stable and privileged = true and that's all! enjoy!


1

Found the answer here Just add --network=host to docker build or docker run. docker build --network=host foo/bar:latest .


1

This functionality is built straight into travis. Have a look at here. Secondly you should not need to specify a branch as part of your make script as travis will triggered on a specific branch and therefore that revision would already be checked out.


Only top voted, non community-wiki answers of a minimum length are eligible