yeka / test

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test

This is my testing ground. It uses docker heavily for ease of setup.

Contents

Docker Tricks

1. Accessing Container via IP Address

When using docker, the common usage is to use port forwarding via -p option. Accessing containers via it's IP address is only possible in linux. On Mac and Windows, docker container runs inside a some kind of virtual box.

To access container via IP on Mac, one can utilize sshuttle which require to run an ssh-server container.

docker run --rm --name sshdocker -p 2222:22 -d rastasheep/ubuntu-sshd:14.04
sshuttle -r root@127.0.0.1:2222 -N 172.17.0.0/24

Normally, container's IP is on 172.17.0.*. You can check it using docker container inspect [container_name] | grep IPAddress The default root password for rastasheep/ubuntu-sshd:14.04 is root.

Note: I haven't been able to run sshuttle against alpine-based ssh server. That's why ubuntu-based sshd is used.

About


Languages

Language:Go 55.7%Language:HCL 32.3%Language:JavaScript 9.5%Language:HTML 1.1%Language:CSS 1.1%Language:Dockerfile 0.3%