Skip to content

Latest commit

 

History

History
148 lines (120 loc) · 5.89 KB

README.org

File metadata and controls

148 lines (120 loc) · 5.89 KB

:tools docker

Description

This module allows you to manipulate Docker images, containers, and more from Emacs.

Provides a major dockerfile-mode to edit Dockerfiles. Additional convenience functions allow images to be built easily.

doom-package:docker-tramp offers TRAMP support for Docker containers.

Maintainers

This module has no dedicated maintainers. Become a maintainer?

Module flags

+lsp
Enable integration for the Dockerfile Language Server.

Packages

  • doom-package:docker
  • doom-package:docker-tramp
  • doom-package:dockerfile-mode

Hacks

No hacks documented for this module.

Changelog

This module does not have a changelog yet.

Installation

Enable this module in your doom! block.

This module assumes docker, docker-compose and docker-machine binaries are installed and accessible from your PATH.

Optionally, this module also uses the following programs:

  • docker-langserver (for LSP users): $ npm install -g dockerfile-language-server-nodejs

Usage

🔨 This module’s usage documentation is incomplete. Complete it?

Docker control

Use M-x docker, select a resource, and then mark or unmark items using the following keybindings (for more marking possibilities, check out politza/tablist):

BindingDescription
?List actions
lConfigure listing
mMark item
uUnmark item
tToggle marks
UUnmark all
sSort
* rMark items by regexp
<Shrink column
>Enlarge column
C-c C-eExport to csv

Supported commands

  • docker container: attach, cp, diff, inspect, kill, logs, pause, rename, restart, rm, start, stop, unpause
  • docker image: inspect, pull, push, rm, run, tag
  • docker network: rm
  • docker volume: rm
  • docker-machine: create, env, restart, rm, start, stop
  • docker-compose: build, config, create, down, exec, logs, pull, push, remove, restart, run, start, stop, up

    You can also enter dired or open a file inside a container or volume.

TRAMP

Offers the TRAMP method docker to access running containers:

C-x C-f /docker:$USER@$CONTAINER:/path/to/file
$USERthe user that you want to use (optional)
$CONTAINERthe id or name of the container

Configuration

🔨 This module’s configuration documentation is incomplete. Complete it?

Popups

Thanks to magit-popup, all the popups default arguments can be customized. For example, here is how to customize the arguments for docker-image-run-popup:

(setq docker-image-run-arguments '("-i" "-t" "--rm"))

or inside a use-package declaration:

(use-package! docker
  :bind ("C-c d" . docker)
  :custom (docker-image-run-arguments '("-i" "-t" "--rm")))

Other useful variables

VariableDescriptionDefault
docker-commandThe docker binary to usedocker
docker-container-default-sort-keySort key for docker containers("Image")
docker-container-shell-file-nameShell to use when entering containers/bin/bash
docker-image-default-sort-keySort key for docker images("Repository")
docker-machine-default-sort-keySort key for docker machines("Name")
docker-network-default-sort-keySort key for docker networks("Name")
docker-run-as-rootRun docker as rootnil
docker-volume-default-sort-keySort key for docker volumes("Driver")

Completion in Dockerfiles

By default, the keyword completion function detects the docker-compose version of the current buffer and suggests the appropriate keywords.

You can change the candidates offered by the backend by customizing docker-compose-keywords.

Troubleshooting

Report an issue?

Tramp hangs on Alpine container

Busyboxes built with the ENABLE_FEATURE_EDITING_ASK_TERMINAL config option also send escape sequences, which tramp-wait-for-output doesn’t ignore correctly. This was fixed in TRAMP upstream and is available since TRAMP 2.3.

For older versions of TRAMP you can dump docker-tramp-compat.el in your load-path somewhere and add the following to $DOOMDIR/config.el to overwrite tramp-wait-for-output with the patch applied:

(after! tramp
  (require 'docker-tramp-compat))

Frequently asked questions

This module has no FAQs yet. Ask one?

Appendix

🔨 This module has no appendix yet. Write one?