Open sfmskywalker opened 4 years ago
@sfmskywalker I've glanced at this issue a couple of times already but I don't have great ideas. Weren't you able to solve it?
It looks like something is wrong in your CI setup, since the local build works. What happens if you try to build the docker image outside of Pulumi, as a separate step in the pipeline?
@mikhailshilkov Unfortunately not - I'm completely blocked by it for GitLab -_-
When I build the docker image outside of pulumi, it works fine. But I used a different build image for that (docker:stable
with service docker:dind
). Tomorrow I will try to do the same in the build yaml containing the Pulumi steps.
I tried the DIND approach, but then it fails because of ./setup.sh: not found
.
The .gitlab.yml looks like this:
stages:
- build
pulumi:
stage: build
image: docker:stable
services:
- docker:dind
before_script:
- chmod +x *.sh
- ./setup.sh
script:
- ./pulumi-up.sh
artifacts:
paths:
- pulumi-log.txt
expire_in: 1 week
only:
- master
pulumi-preview:
stage: build
image: docker:stable
services:
- docker:dind
before_script:
- chmod +x *.sh
- ./setup.sh
script:
- ./pulumi-preview.sh
only:
- merge_requests
The setup.sh
file does exist in the repo's root, and it's fine if I use a .NET docker image for this build. So clearly I'm misunderstanding how DIND works. I'll try and get a better understanding of how this is supposed to work, but any suggestions in the mean time would be thoroughly appreciated.
As a plan B, I might let go of letting Pulumi build the docker image, and simply leave that part to GitLab. Instead, I would have my infra Pulumi code simply post the container registry credentials to a GitLab project's Variables section.
I'm having the same issue. Hoping to use pulumi exclusively to do all things. My pulumi project is in dotnet, so obviously in my circle ci project I need to reference a dotnet base image (executor), but then that image doesnt contain docker itself (dind) so the pulumi dotnet project fails when it tries to build the docker image.
Did you end up building the docker image outside of pulumi?
Yes, I ended up building the docker image outside of pulumi.
Thanks for replying... I figured out how to do it inside pulumi, by adding this config in my circle-ci config
- setup_remote_docker:
version: 20.10.7
docker_layer_caching: true
Not sure if the same exists in gitlab
Great! I'll give that a go next time. Thanks for sharing!
I'm not sure if this is an issue with GitLab,
Pulumi.Docker.Image.Image
, or myself (most likely :D), but I'm at my wits end here.Problem description
I have a very simple Pulumi C# project that builds a Docker image from a Dockerfile. This works fine on my local machine (building the image works, but I haven't configured a registry server, so pushing the built image fails - this is expected).
But when I try and run this project from GitLab, it fails with a
System.ComponentModel.Win32Exception (2): No such file or directory
error when trying to build the image.Steps to reproduce
First let's make sure it works locally:
/infra/MyApplication.Infra
and dopulumi up
.Now create a PR and observe the build pipeline or simply trigger one. Notice the following error:
Initially I thought perhaps it doesn't like that the
Dockerfile
is two levels up, so I copied it to the same directory as where the Pulumi .csproj file lives and updated the code accordingly. However, the build failed with the same error.I'm certain I am missing something important, but I need a little help understanding it. Thanks in advance!