如何卸载docker-compose?

时间:2015-06-22 19:48:57

标签: macos docker docker-compose

我按照官方文档安装了docker-compose:http://docs.docker.com/compose/install/

现在我要卸载docker-compose。

$ docker-compose -h

没有提供卸载命令,官方文档也没有提供任何说明。

我删除了我的docker-compose.yml文件和/ usr / local / bin / docker-compose,但我想确保这一切。

我在MacbookPro上使用OSX Yosemite 10.10.3。

编辑:关于我遵循的安装说明,我没有使用pip。我使用了记录的curl命令:

$ curl -L https://github.com/docker/compose/releases/download/1.3.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
$ chmod +x /usr/local/bin/docker-compose

3 个答案:

答案 0 :(得分:39)

Documenation

<强> Please note that this is now in the docs 即可。

耦合安装和拆卸

注意:在Mac Docker now installs Docker Compose上。因此,删除策略已经发生了一些变化。如果你uninstall Docker,并且想要同时卸载它们,那么你也卸载了Docker Compose。

使用curl

安装时删除个人

它通常安装在mac上的/usr/local/bin/docker-compose。但是,您可以运行which docker-compose来查找确切位置。

运行以下命令(* nix系统)以删除:

rm $(which docker-compose)

如果您收到权限被拒绝错误,那么您需要添加sudo

sudo rm $(which docker-compose)

要验证它是否成功,请运行以下命令,该命令不应返回任何内容:

which docker-compose

应该说命令没有找到。

使用PIP安装时删除个人

如果您已使用PIP安装了Docker Compose,则可以运行:

pip uninstall docker-compose

如果您收到权限被拒绝错误,则可能必须使用sudo

sudo pip uninstall docker-compose

答案 1 :(得分:3)

现在docker-compose是docker工具箱的一部分。
如果您想删除Docker Toolbox附带的所有内容包括Docker 本身)。

您可以执行此shell脚本:

#!/bin/bash

# Uninstall Script

if [ "${USER}" != "root" ]; then
    echo "$0 must be run as root!"
    exit 2
fi

while true; do
  read -p "Remove all Docker Machine VMs? (Y/N): " yn
  case $yn in
    [Yy]* ) docker-machine rm -f $(docker-machine ls -q); break;;
    [Nn]* ) break;;
    * ) echo "Please answer yes or no."; exit 1;;
  esac
done

echo "Removing Applications..."
rm -rf /Applications/Docker

echo "Removing docker binaries..."
rm -f /usr/local/bin/docker
rm -f /usr/local/bin/docker-machine
rm -r /usr/local/bin/docker-machine-driver*
rm -f /usr/local/bin/docker-compose

echo "Removing boot2docker.iso"
rm -rf /usr/local/share/boot2docker

echo "All Done!"

如果你仍然有折旧的 Boot2docker ,你也想要摆脱它。

您可以通过执行以下shell脚本来卸载它:

#!/bin/bash

# Uninstall Script

if [ "$(which boot2docker)" == "" ]; then
    echo "boot2docker does not exist on your machine!"
    exit 1
fi

if [ "${USER}" != "root" ]; then
    echo "$0 must be run as root!"
    exit 2
fi

echo "Stopping boot2docker processes..."
boot2docker stop && boot2docker delete

echo "Removing boot2docker executable..."
rm -f /usr/local/bin/boot2docker

echo "Removing boot2docker ISO and socket files..."
rm -rf ~/.boot2docker
rm -rf /usr/local/share/boot2docker

echo "Removing boot2docker SSH keys..."
rm -f ~/.ssh/id_boot2docker*

echo "Removing boot2docker OSX files..."
rm -f /private/var/db/receipts/io.boot2docker.*
rm -f /private/var/db/receipts/io.boot2dockeriso.*

echo "Removing Docker executable..."
rm -f /usr/local/bin/docker

echo "All Done!"

答案 2 :(得分:-1)

我会使用var url = require('url'); //Require express, var express = require('express'); //and create an app var app = express(); //app.get() which represents the HTTP GET method app.get('/', function (req, res) { res.send('Hello World!'); }); //app.get() which represents the HTTP GET method param1/:param1/param2/:param2 app.get('/calc', function (req, res) { url_parts = url.parse(req.url, true); console.log(url); console.log(url_parts); a = parseInt(url_parts.query.param1); console.log(a); b = parseInt(url_parts.query.param2); console.log(b); output = a+b; console.log(output); res.writeHead(200, { 'Content-Type': 'text/html', 'Access-Control-Allow-Origin' : '*'}); res.end(output + "\n"); }); var server = app.listen(8000, function () { var host = server.address().address; var port = server.address().port; console.log('Example app listening at http://' + host + ':' + port); });