Packages
graphqexl
0.1.0-alpha-rc.21
0.1.0
0.1.0-alpha-rc.docs-test-6
0.1.0-alpha-rc.docs-test-5
0.1.0-alpha-rc.docs-test-4
0.1.0-alpha-rc.docs-test-3
0.1.0-alpha-rc.docs-test-2
0.1.0-alpha-rc.docs-test
0.1.0-alpha-rc.25
0.1.0-alpha-rc.24
0.1.0-alpha-rc.23
0.1.0-alpha-rc.22
0.1.0-alpha-rc.21
0.1.0-alpha-rc.20
0.1.0-alpha-rc.19
0.1.0-alpha-rc.18
0.1.0-alpha-rc.17
0.1.0-alpha-rc.16
0.1.0-alpha-rc.15
0.1.0-alpha-rc.14
0.1.0-alpha-rc.13
0.1.0-alpha-rc.12
0.1.0-alpha-rc.11
0.1.0-alpha-rc.10
0.1.0-alpha-rc.9
0.1.0-alpha-rc.8
0.1.0-alpha-rc.7
0.1.0-alpha-rc.6
0.1.0-alpha-rc.5
0.1.0-alpha-rc.4
0.1.0-alpha-rc.3
0.1.0-alpha-rc.2
0.1.0-alpha-rc.1
0.1.0-alpha.rc-4
0.1.0-alpha.rc.4
Fully-loaded, pure-Elixir GraphQL server implementation with developer tools
Current section
Files
Jump to
Current section
Files
lib/mix/tasks/docker/build.ex
defmodule Mix.Tasks.Docker.Build do
@moduledoc """
Build the application's Docker Image
"""
@doc """
Build the application's Docker image
ARGS
- image_name, string, e.g.: "graphqexl"
- image_repo, string, e.g.: "gcr.io/absynthe"
- release_name, string, e.g.: "stable"
"""
@doc since: "0.1.0"
@spec run([String.t]) :: :ok
def run([image_name, image_repo, release_name]) do
IO.puts "[STARTING] Building #{image_repo}/#{image_name}:#{release_name} Docker image..."
image_name
|> docker_build(image_repo, release_name)
|> run_with_buildkit
IO.puts "[DONE] Building #{image_repo}/#{image_name}:#{release_name} Docker image..."
end
@doc false
defp build_params(image_name, image_repo, release_name) do
["build", ".", "-t", "#{image_repo}/#{image_name}", "--build-arg", "release_name=#{release_name}"]
end
@doc false
defp docker_build(image_name, image_repo, release_name) do
{"docker", image_name |> build_params(image_repo, release_name)}
end
@doc false
defp run_with_buildkit({cmd, args}) do
System.cmd(cmd, args, env: [{"DOCKER_BUILDKIT", "1"}], into: IO.stream(:stdio, :line))
end
end