#Adding a .dockerignore using the Go SDK?

1 messages · Page 1 of 1 (latest)

buoyant flicker
#

I am using the Go SDK to build our pipeline, one of the pieces I was looking at was how to add a .dockerignore during the build process. I know I can just use Go to create a physical file, but wondering if there was a better way to generate the .dockerignore when using the SDK.

flint pumice
#

Hmmm.. I don't think there's a simpler way to do it. As you said, it's basically appending strings to a file; there's nothing particularly specific about the .dockerignore syntax. Doing the file creation in go should be pretty straightforward

buoyant flicker
#

Will stick with that, thank you!

neon vine
#

@buoyant flicker You can do that programmatically using the Include/Exclude options in Host().Directory()

#

Not to generate the .dockerignore file, but basically to get the same behavior from the Go SDK

flint pumice
#

right.. thx Andrea. I assumed you needed to create the .dockerignore Jason, but if you're looking for the same functionality in the Go SDK, the host.Directory step has the include and exclude arguments which provide the same functionality as .dockerignore.

thick comet
#

(that was a "jason" joke btw)

buoyant flicker
#

LOL, I'm actually bummed I missed message originally @thick comet

thick comet
#

In an additional plot twist @buoyant flicker this whole time I thought @flint pumice made a typo from JSON to Jason. Only now do I realize he was addressing you. I don’t even know what I was thinking since .dockerignore is definitely NOT json…