Function: dockerfile-build-buffer
dockerfile-build-buffer is an interactive and natively compiled
function defined in dockerfile-mode.el.
Signature
(dockerfile-build-buffer IMAGE-NAME &optional NO-CACHE)
Documentation
Build an image called IMAGE-NAME based upon the buffer.
If the prefix arg NO-CACHE is set, don't cache the image.
The shell command used to build the image is:
sudo docker build \
--no-cache \
--force-rm \
--pull \
--tag IMAGE-NAME \
--build-args args \
--progress type \
-f filename \
directory
Key Bindings
dockerfile-mode-map C-c C-b
Source Code
;; Defined in /nix/store/wfmjr60p5jy1p85wbrh60l5f6r52la4p-emacs-packages-deps/share/emacs/site-lisp/elpa/dockerfile-mode-20251221.1644/dockerfile-mode.el
;;;###autoload
(defun dockerfile-build-buffer (image-name &optional no-cache)
"Build an image called IMAGE-NAME based upon the buffer.
If the prefix arg NO-CACHE is set, don't cache the image.
The shell command used to build the image is:
sudo docker build \\
--no-cache \\
--force-rm \\
--pull \\
--tag IMAGE-NAME \\
--build-args args \\
--progress type \\
-f filename \\
directory"
(interactive (list (dockerfile-read-image-name) prefix-arg))
(save-buffer)
(compilation-start
(format
"%s%s%s build %s %s %s %s %s --progress %s %s -f %s %s"
(if dockerfile-use-buildkit "DOCKER_BUILDKIT=1 " "")
(if dockerfile-use-sudo "sudo " "")
dockerfile-mode-command
(if no-cache "--no-cache" "")
(if dockerfile-build-force-rm "--force-rm " "")
(if dockerfile-build-pull "--pull " "")
(dockerfile-tag-string image-name)
(dockerfile-build-arg-string)
dockerfile-build-progress
(or dockerfile-build-extra-options "")
(shell-quote-argument (dockerfile-standard-filename
(or (file-remote-p (buffer-file-name) 'localname)
(buffer-file-name))))
(shell-quote-argument (dockerfile-standard-filename
(or (file-remote-p default-directory 'localname)
default-directory))))
nil
(lambda (_) (format "*docker-build-output: %s *" image-name))))