Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Bash by rojkov ( 9 years ago )
#!/bin/sh -xe

CWD=`dirname $0`
PWD=`pwd`
WORKSPACE=`realpath $PWD`

PROXY_VARS="http_proxy https_proxy"

BUILD_ARGS="--build-arg uid=`id -u` --build-arg gid=`id -g` --build-arg USER=${USER}"
RUN_ARGS="-u `id -u`"

for proxy in $PROXY_VARS; do
    if [ -v $proxy ]; then
        val=`echo ${!proxy} | tr -d ' '`
        BUILD_ARGS="${BUILD_ARGS} --build-arg $proxy=${val}"
        RUN_ARGS="$RUN_ARGS -e $proxy=${!proxy}"
    fi
done

#docker build -t ubuntu-azure $BUILD_ARGS "$CWD/ubuntu-azure/"

docker run --rm=true -it $RUN_ARGS -e LANG=en_US.UTF-8 \
    -v $WORKSPACE:$WORKSPACE:rw \
    -v $HOME:$HOME:ro \
    -w $WORKSPACE \
    ubuntu:rojkov /bin/bash

 

Revise this Paste

Your Name: Code Language: