% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utility-functions.R
\name{docker_build}
\alias{docker_build}
\alias{docker_build.character}
\alias{docker_build.Dockerfile}
\title{Build a Docker image from a local Dockerfile or a \code{Dockerfile} object}
\usage{
docker_build(x, tag, ...)

\method{docker_build}{character}(
  x,
  tag = strsplit(tempfile(pattern = "containerit_", tmpdir = ""), "/")[[1]][2],
  the_dockerfile = "Dockerfile",
  ...
)

\method{docker_build}{Dockerfile}(
  x,
  tag = strsplit(tempfile(pattern = "containerit_test_", tmpdir = ""), "/")[[1]][2],
  use_workdir = FALSE,
  clean_up = TRUE,
  ...
)
}
\arguments{
\item{x}{the path to a directory with a valid \code{Dockerfile} (i.e. the \code{context}), or a \code{Dockerfile} object}

\item{tag}{Name of the new image to be created}

\item{...}{Other arguments, passed to \code{\link[stevedore]{docker_client}}}

\item{the_dockerfile}{Name of the \code{Dockerfile}, defaults to "Dockerfile"}

\item{use_workdir}{if a \code{\link{Dockerfile}} object is given, this can set the context to the current working directory (if \code{TRUE}) or a temporary directory (default)}

\item{clean_up}{if \code{use_workdir}, then delete the Dockerfile file in the working directory, otherwise remove the Dockerfile created as a temporary file}
}
\value{
The id of the image
}
\description{
The method is implemented based on \pkg{stevedore} and includes some logging and defaults.
If a \code{Dockerfile} object is given, it is saved as a Dockerfile to a temporary directory.
}
