25
23

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CoreOSにdocker-composeとBash-Completion

Last updated at Posted at 2015-07-14

CoreOSにDocker Composeがなかったので導入した作業ログ

環境

$ cat /etc/os-release 
NAME=CoreOS
ID=coreos
VERSION=738.1.0
VERSION_ID=738.1.0
BUILD_ID=
PRETTY_NAME="CoreOS 738.1.0"
ANSI_COLOR="1;32"
HOME_URL="https://coreos.com/"
BUG_REPORT_URL="https://github.com/coreos/bugs/issues"

$ echo $SHELL
/bin/bash

$ docker version
Client version: 1.6.2
Client API version: 1.18
Go version (client): go1.4.2
Git commit (client): 7c8fca2-dirty
OS/Arch (client): linux/amd64
Server version: 1.6.2
Server API version: 1.18
Go version (server): go1.4.2
Git commit (server): 7c8fca2-dirty
OS/Arch (server): linux/amd64

docker-composeを導入

$ sudo -i
# mkdir -p /opt/bin
# curl -L https://github.com/docker/compose/releases/download/1.4.2/docker-compose-`uname -s`-`uname -m` > /opt/bin/docker-compose
# chmod +x /opt/bin/docker-compose
# docker-compose -v
docker-compose version: 1.4.2

Bash-Completion

https://www.binarysludge.com/2014/10/21/install-bash-completion-on-coreos/
$ toolbox dnf -y install bash-completion wget \
  && toolbox wget https://raw.githubusercontent.com/docker/docker/master/contrib/completion/bash/docker -O /usr/share/bash-completion/completions/docker \
  && toolbox cp /usr/share/bash-completion /media/root/var/ -R  \
  && source /var/bash-completion/bash_completion
$ cp $(readlink .bashrc) .bashrc.new && mv .bashrc.new .bashrc
$ echo "source /var/bash-completion/bash_completion" >> ~/.bashrc

docker-compose用補完ファイル

$ sudo -i
# curl -L https://raw.githubusercontent.com/docker/compose/1.4.2/contrib/completion/bash/docker-compose > /var/bash-completion/completions/docker-compose 

CoreOSにはパッケージマネージャがない代わりのような立ち位置にtoolboxが付属してます。

タブしてみる

$ docker-compose 
build              kill               migrate-to-labels  ps                 restart            run                start              up                 
help               logs               port               pull               rm                 scale              stop               version

おー。補完されました。

25
23
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
25
23

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?