1
1

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 3 years have passed since last update.

メモ: Proxy 環境下での Docker

Last updated at Posted at 2020-04-28

docker pull

mkdir /etc/systemd/system/docker.service.d

cat << EOL > /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=http://192.168.0.99:8888"
EOL

sudo systemctl daemon-reload
sudo systemctl restart docker
systemctl show --property=Environment docker
docker pull ubuntu:20.04

docker run

docker run \
 -it --rm \
 -e http_proxy="http://192.168.0.99:8888" \
 -e https_proxy="http://192.168.0.99:8888" \
 -v $(pwd)/deb:/deb \
 ubuntu:20.04 /bin/bash

ホストのProxy設定

~/.bashrc
export http_proxy="http://192.168.0.99:8888"
export https_proxy=$http_proxy
export no_proxy=localhost,.example.com
1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?