/dev-env

Building my own docker dev environment based on ubuntu.

Primary LanguageDockerfile

dev-env

Install Docker Engine

Build

docker build --no-cache -t rickkky/dev-env:0.0.11 .

Github Proxy

Start

docker create --name dev-box -h dev-box -u ricky -v codespace:/home/ricky/codespace -it rickkky/dev-env:0.0.11 zsh

docker start dev-box

docker exec -it dev-box zsh

Rewrite the permission of codespace volume:

sudo chown 777 /home/ricky/codespace

Terminal Request Proxy

假设代理端口为 7890

PowerShell

# Check the environment variables.
ls env:

# Setup proxy.
$env:ALL_PROXY="http://127.0.0.1:7890"
# or
$env:HTTP_PROXY="http://127.0.0.1:7890"
$env:HTTPS_PROXY="http://127.0.0.1:7890"

# Reset proxy.
$env:ALL_PROXY=""
# or
$env:HTTP_PROXY=""
$env:HTTPS_PROXY=""

WSL

# Check the environment variables.
echo $ALL_PROXY

# Setup proxy.
host_ip=$(cat /etc/resolv.conf |grep "nameserver" |cut -f 2 -d " ")
export ALL_PROXY="http://$host_ip:7890"

# Reset proxy.
unset ALL_PROXY

Or add the following settings to ~/.wslconfig on Windows11.

networkingMode=mirrored
dnsTunneling=true
autoProxy=true

Accessing network applications with WSL

SSH

ssh-keygen -t ed25519 -C "rickkky@foxmail.com"

ssh-add ~/.ssh/id_ed25519

Generating a new SSH key and adding it to the ssh-agent

Rust

$ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh

Install Rust