From 4da94bc4cabeafc5e5ec58952278df30303900cf Mon Sep 17 00:00:00 2001 From: JAremko Date: Mon, 20 May 2019 13:53:07 +0300 Subject: [PATCH] Use single dockerfile At the moment of this commit the images haven't been updated yet --- Dockerfile.emacs25 => Dockerfile | 3 - Dockerfile.snapshot | 58 ------------------- .../spacemacs-docker/README.org | 29 +++++----- 3 files changed, 14 insertions(+), 76 deletions(-) rename Dockerfile.emacs25 => Dockerfile (96%) delete mode 100644 Dockerfile.snapshot diff --git a/Dockerfile.emacs25 b/Dockerfile similarity index 96% rename from Dockerfile.emacs25 rename to Dockerfile index d7591b9d9..c3d3ce802 100644 --- a/Dockerfile.emacs25 +++ b/Dockerfile @@ -12,9 +12,6 @@ ## See spacemacs/layers/+distributions/spacemacs-docker/README.org FROM jare/emacs:latest -# FROM jare/emacs:emacs24 -# Emacs snapshot -# FROM jare/emacs:testing MAINTAINER JAremko diff --git a/Dockerfile.snapshot b/Dockerfile.snapshot deleted file mode 100644 index 17f63c5e1..000000000 --- a/Dockerfile.snapshot +++ /dev/null @@ -1,58 +0,0 @@ -### Dockerfile --- spacemacs-docker dockerfile with Emacs snapshot -## -## Copyright (c) 2012-2018 Sylvain Benner & Contributors -## -## Author: Eugene "JAremko" Yaremenko -## -## -## This file is not part of GNU Emacs. -## -### License: GPLv3 -## -## See spacemacs/layers/+distributions/spacemacs-docker/README.org - -# FROM jare/emacs:latest -# FROM jare/emacs:emacs24 -# Emacs snapshot -FROM jare/emacs:testing - -MAINTAINER JAremko - -ENV UNAME="spacemacser" \ - UID="1000" - -# Default fonts -ENV NNG_URL="https://github.com/google/fonts/raw/master/ofl/\ -nanumgothic/NanumGothic-Regular.ttf" \ - SCP_URL="https://github.com/adobe-fonts/source-code-pro/\ -archive/2.030R-ro/1.050R-it.tar.gz" -RUN apt-get update && apt-get install wget \ - && mkdir -p /usr/local/share/fonts \ - && wget -qO- "${SCP_URL}" | tar xz -C /usr/local/share/fonts \ - && wget -q "${NNG_URL}" -P /usr/local/share/fonts \ - && fc-cache -fv \ - && apt-get purge wget \ - && rm -rf /tmp/* /var/lib/apt/lists/* /root/.cache/* - -# UHOME is /home/emacs (from jare/emacs) -ADD . ${UHOME}/.emacs.d - -# Init Spacemacs -RUN cp ${UHOME}/.emacs.d/core/templates/.spacemacs.template ${UHOME}/ \ - && mv ${UHOME}/.spacemacs.template ${UHOME}/.spacemacs \ - && sed -i "s/\(-distribution 'spacemacs\)/\1-docker/" \ - ${UHOME}/.spacemacs \ - && asEnvUser emacs -batch -u ${UNAME} -kill \ - && asEnvUser emacs -batch -u ${UNAME} -kill \ - && chmod ug+rw -R ${UHOME} - -# Test Spacemacs -RUN asEnvUser make -C ${UHOME}/.emacs.d/tests/core/ test \ - && cd ${UHOME}/.emacs.d \ - && printf "SPACEMACS REVISION: %s\n" "$(git rev-parse --verify HEAD)" - -RUN ln -s \ - ${UHOME}/.emacs.d/layers/+distributions/spacemacs-docker/deps-install/run \ - /usr/local/sbin/install-deps \ - && chown root:root /usr/local/sbin/install-deps \ - && chmod 770 /usr/local/sbin/install-deps diff --git a/layers/+distributions/spacemacs-docker/README.org b/layers/+distributions/spacemacs-docker/README.org index f20c31d01..fdcf49b0f 100644 --- a/layers/+distributions/spacemacs-docker/README.org +++ b/layers/+distributions/spacemacs-docker/README.org @@ -33,7 +33,6 @@ with GUI support on all major platforms and even [[https://i.imgur.com/wDLDMZN.g - Try new tools, experiment and roll back changes when something goes wrong - Share your setup with others or extend someone else’s development environment - Run multiple Emacs instances on the same machine isolated -- An easy way to swap Emacs version (=emacs25= =emacs-snapshot=) for debugging - [[https://docs.docker.com/engine/reference/commandline/pause/][pause]] container to free resources temporarily - [[https://github.com/docker/docker/blob/1.13.x/experimental/checkpoint-restore.md][Checkpoint & Restore]] - maybe the fastest way to start a “heavy” environment - Friendly for networks with low upload speed/quotas. @@ -52,14 +51,14 @@ with GUI support on all major platforms and even [[https://i.imgur.com/wDLDMZN.g [[https://i.imgur.com/WmsnCUo.jpg][HD Windows image]] * How to setup -The idea is to build your own image [[https://docs.docker.com/engine/reference/builder/#from][FROM]] the one of the provided base images -([[https://goo.gl/Rb2Als][spacemacs/emacs25:develop]] and [[https://goo.gl/DFSenZ][spacemacs/emacs-snapshot:develop]]). Get [[https://docs.docker.com/engine/installation][docker]] for the OS of +The idea is to build your own image [[https://docs.docker.com/engine/reference/builder/#from][FROM]] the one of provided base images. +Get [[https://docs.docker.com/engine/installation][docker]] for the OS of the machine that will run development environment and then use [[https://github.com/JAremko/spacemacs-docker-seed][spacemacs-docker-seed]] as an example to create [[https://docs.docker.com/docker-hub/builds/][automated builds on Docker Hub]] or [[https://docs.docker.com/engine/reference/commandline/build/][build it locally]]. * How to use -With one of the methods below replace =spacemacs/emacs25:develop= with your images. +With one of the methods below replace =spacemacs/develop= with your images. NOTE: The guide assumes that you want to run Docker and connect to it from the same machine. @@ -74,7 +73,7 @@ tab and make sure you’ve got “Allow connections from network clients” tick -e DISPLAY=$ip:0 \ -e TZ= \ -v :/mnt/workspace \ - spacemacs/emacs25:develop + spacemacs/develop #+END_SRC [[https://fredrikaverpil.github.io/2016/07/31/docker-for-mac-and-gui-applications][source]], @@ -93,7 +92,7 @@ Get [[https://www.cygwin.com][Cygwin]] with =xinit=, =xorg-server= and optionaly docker run --name spacemacs \ -e DISPLAY="$DISPLAY" \ -v :/mnt/workspace \ - spacemacs/emacs25:develop + spacemacs/develop #+END_SRC Or with =-ti= via =winpty= @@ -102,7 +101,7 @@ Or with =-ti= via =winpty= winpty docker run -ti --name spacemacs \ -e DISPLAY="$DISPLAY" \ -v :/mnt/workspace \ - spacemacs/emacs25:develop + spacemacs/develop #+END_SRC [[http://manomarks.github.io/2015/12/03/docker-gui-windows.html][source]] @@ -122,7 +121,7 @@ Make sure that =$DISPLAY= variable is set -v /etc/machine-id:/etc/machine-id:ro \ -v /var/run/dbus:/var/run/dbus \ -v :/mnt/workspace \ - spacemacs/emacs25:develop + spacemacs/develop #+END_SRC =UID= and preferably =UNAME= should match the host’s user id. You can set them @@ -171,7 +170,7 @@ Get [[https://xpra.org/][Xpra]] client for your OS. then --volumes-from x11-bridge \ -e DISPLAY=:14 \ -e TZ= \ - spacemacs/emacs25:develop + spacemacs/develop #+END_SRC Now you can connect to it with Xpra desktop client @@ -195,7 +194,7 @@ Now you can connect to it with Xpra desktop client --volumes-from x11-bridge \ -e TZ= \ -e DISPLAY=:14 \ - spacemacs/emacs25:develop + spacemacs/develop #+END_SRC Now visit [[http://localhost:10000/index.html?encoding=png&password]] = @@ -203,12 +202,12 @@ Now visit [[http://localhost:10000/index.html?encoding=png&password]] = = - Manage data in containers with [[https://docs.docker.com/engine/tutorials/dockervolumes/][Docker volumes]]. Example - =docker volume create --name my-ws= - - =docker run ... -v my-ws:/mnt/workspace ... spacemacs/emacs25:develop= + - =docker run ... -v my-ws:/mnt/workspace ... spacemacs/develop= - =docker run ... -v my-ws:/home/developer/workspace ... jare/vim-bundle=