Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build Docker Image with Fake

Tags:

docker

f#-fake

Is there a straightforward, concise way to build Docker Images with Fake? I'm looking at the API Doc's from Fake's site and I don't see anything Docker related. I can wrap the command line interface for docker, but I'd rather not re-invent the wheel if I don't need to.

like image 849
JoelHess Avatar asked Dec 20 '16 21:12

JoelHess


1 Answers

I ended up just going the route of calling the command line

Target "BuildDocker" (fun _ ->
trace "Building Docker Image"

let result =
    ExecProcess (fun info ->
        info.FileName <- ("Docker.exe")
        info.Arguments <- ("build -t \"docker/api:develop\" ." )
        info.WorkingDirectory <- (dockerDir @@ "/api") 
    ) (System.TimeSpan.FromMinutes 5.)

if result <> 0 then failwith "Failed result from Docker"
)
like image 188
JoelHess Avatar answered Nov 15 '22 04:11

JoelHess