I am running docker and I want bash command completion for docker commands and parameters. The official Docker for Mac page has a section on installing bash. May 13, 2015 - apt-get install bash-completion. Open a new shell. If completion is still not functioning you may need to add (or uncomment) the following lines. Docker CLI Bash completion on MacOS Docker CLI tool has many commands. Word for mac 2016 page break skips number. If you are also managing a large number of containers, images and networks you will find yourself going back and forth to remember all names, identifiers and parameters. Scr3310 card reader. To get some help in this task we can use bash-autocompletion so it does all the magic for us when we push the 'tab' key. First, install bash-completion If you have homebrew installed it is really easy, just do the following: brew install bash-completion If you don't have brew, please follow the instructions in. Second, add docker completion They are already installed with Docker for Mac. So, let's link them in: /usr/local/etc/bash_completion.d cd /usr/local/etc/bash_completion.d ln -s /Applications/Docker.app/Contents/Resources/etc/docker.bash-completion ln -s /Applications/Docker.app/Contents/Resources/etc/docker-machine.bash-completion ln -s /Applications/Docker.app/Contents/Resources/etc/docker-compose.bash-completion Third, configure your bash_profile Add the following to your use's.bash_profile: if [ -f $(brew --prefix)/etc/bash_completion ]; then. $(brew --prefix)/etc/bash_completion fi That piece of code will load all the profiles stored in the previous directory. That means that our 'docker' auto-completion code will be enabled. Fourth, and final step, test it Just write docker container create and press tab twice to get the auto-completion. No need to remember or check the names of the images you have anymore:) $ docker container create [tab tab] alpine debian httpd mysql nginx:latest ubuntu:14.04 alpine:latest debian:latest httpd:latest mysql:5.6 percona ubuntu:latest centos elasticsearch mongo mysql:latest percona:latest ubuntu:trusty centos:7 elasticsearch:2 mongo:latest nginx ubuntu. 此内容还未提供中文版,以下为英文版 Get started with Docker for Mac 预计阅读时间: 15 分钟 Welcome to Docker for Mac! Docker is a full development platform for creating containerized apps, and Docker for Mac is the best way to get started with Docker on a Mac. Got Docker for Mac? If you have not yet installed Docker for Mac, please see for an explanation of stable and edge channels, system requirements, and download/install information. Looking for system requirements? Check out, which has moved to the new install topic. Filezilla. Check versions of Docker Engine, Compose, and Machine Run these commands to test if your versions of docker, docker-compose, and docker-machine are up-to-date and compatible with Docker.app. $ docker --version Docker version 17.03.0-ce, build 60ccb22 $ docker-compose --version docker-compose version 1.11.2, build dfed245 $ docker-machine --version docker-machine version 0.10.0, build 76ed2a6 Note: The above is an example. Your output will differ if you are running different (e.g., newer) versions. Explore the application and run examples • Open a command-line terminal, and run some Docker commands to verify that Docker is working as expected. Some good commands to try are docker version to check that you have the latest release installed, and docker ps and docker run hello-world to verify that Docker is running. • For something more adventurous, start a Dockerized web server.
0 Comments
Leave a Reply. |