How to build Docker Image with Fake

1.4k views Asked by At

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.

1

There are 1 answers

0
JoelHess On BEST ANSWER

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"
)