https://docs.docker.com/engine/installation/linux/ubuntulinux/
Request:
1. HTTP Proxy which supporting both Basic and Digest Authentication2. Test Account root:admin for both Basic and Digest
3. Test Account basic:basic for Basic Authentication
4. Test Account digest:digest for Digest Authentication
5. Test which option make libcurl find the secure one authentication method
sudo apt-get install apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo vi /etc/apt/sources.list.d/docker.list
deb https://apt.dockerproject.org/repo ubuntu-xenial mainsudo apt-get update
sudo apt-get purge lxc-docker
sudo apt-cache policy docker-engine
sudo apt-get update
sudo apt-get install linux-image-extra-$(uname -r)
sudo apt-get update
sudo apt-get install docker-engine
sudo service docker start
Step 2. prepare dockerfile
https://github.com/vash-hsu/docker
Step 3. docker build
docker build -t ubuntu_squid_mixed -f ubuntu.dockerfile.squid_mixed.txt .
Step 4. docker run
docker run --name proxy_mixed -d -p 3128:3128 ubuntu_squid_mixed
Step 5. quick test
curl --verbose -x http://localhost:3128 www.google.com.tw
curl --verbose -x http://localhost:3128 -U root:admin https://www.google.com.tw
curl --verbose -x http://localhost:3128 -U basic:basic https://www.google.com.tw
curl --verbose -x http://localhost:3128 -U digest:digest https://www.google.com.tw
curl --verbose -x http://localhost:3128 -U digest:digest --proxy-digest https://www.google.com.tw
curl --verbose -x http://localhost:3128 -U digest:digest --proxy-anyauth https://www.google.com.tw
Step 6. docker logs
docker ps -qa | awk '{ printf("docker logs %s\n",$1) }' | sh
or
docker logs -f proxy_mixed
Step 7. stop
docker kill `docker ps -qa`
docker rm `docker ps -qa`
Step 8. remove
docker rmi ubuntu_squid_mixed







沒有留言:
張貼留言