Skip to content

Instantly share code, notes, and snippets.

@whacked
Created May 11, 2019 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whacked/2634e9ad05d042e03d43e4ea22e04fde to your computer and use it in GitHub Desktop.
Save whacked/2634e9ad05d042e03d43e4ea22e04fde to your computer and use it in GitHub Desktop.
container test stuff (old)
if false; then
sudo apt-get update
sudo apt-get install -y vim git tmux terminator
# rkt
gpg --keyserver pgp.mit.edu --recv-key 18AD5014C99EF7E3BA5F6CE950BDD3E0FC8A365E
wget https://github.com/rkt/rkt/releases/download/v1.26.0/rkt_1.26.0-1_amd64.deb
wget https://github.com/rkt/rkt/releases/download/v1.26.0/rkt_1.26.0-1_amd64.deb.asc
gpg --verify rkt_1.26.0-1_amd64.deb.asc
sudo dpkg -i rkt_1.26.0-1_amd64.deb
# /rkt
# rkt run --insecure-options=image run docker://silex/emacs --exec emacs -- -nw
fi
if false; then
# docker
# apt-cache search docker
sudo usermod -a -G docker $USER
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install -y docker-ce
# enable experimental
DOCKER_EXPERIMENTAL_CONF=/etc/systemd/system/docker.service.d/experimental.conf
if [ ! -e $DOCKER_EXPERIMENTAL_CONF ]; then
sudo mkdir -p $(dirname $DOCKER_EXPERIMENTAL_CONF)
echo '[Service]' | sudo tee -a $DOCKER_EXPERIMENTAL_CONF
echo 'ExecStart=' | sudo tee -a $DOCKER_EXPERIMENTAL_CONF
echo 'ExecStart=/usr/bin/dockerd -H fd:// --experimental=true' | sudo tee -a $DOCKER_EXPERIMENTAL_CONF
sudo systemctl daemon-reload
sudo systemctl restart docker
# verify thjat Experimental is true
docker version | grep Experimental
fi
fi
# /docker
# this doesn't work with emacs
# check criu
criu check # > Looks good.
# running docker emacs
docker run --name my-emacs -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix jare/emacs emacs
# running rkt emacs
# fix xuathority
cp /home/natto/.Xauthority ./my-Xauthority
# this gives error, BUT creates the file
xauth nlist :0 | sed -e 's/^..../ffff/' | xauth -f my-Xauthority nmerge -
sudo rkt --insecure-options=image run --interactive --volume x11socket,kind=host,source=/tmp/.X11-unix --volume x11auth,kind=host,source=$PWD/my-Xauthority --mount volume=x11socket,target=/tmp/.X11-unix --mount volume=x11auth,target=/root/.Xauthority --set-env=DISPLAY=$DISPLAY docker://jare/emacs --exec emacs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment