Skip to content

Instantly share code, notes, and snippets.

@alphapapa
Forked from jscheid/.dockerignore
Created July 9, 2021 11:08
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 alphapapa/90a241ef3ca7f63fc7da52a433a3652a to your computer and use it in GitHub Desktop.
Save alphapapa/90a241ef3ca7f63fc7da52a433a3652a to your computer and use it in GitHub Desktop.
Running makem in Docker
Dockerfile
/.sandbox/
/.git/
/.sandbox/
*.elc
#!/bin/sh
# * License:
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
set -eou pipefail
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
mkdir -p "$DIR/.sandbox"
exec docker run \
--mount type=bind,source="$DIR",target=/src \
--mount type=bind,source="$DIR/.sandbox",target=/sandbox \
--entrypoint=/usr/bin/emacs \
--interactive \
--tty \
$(docker build . --quiet) \
--eval "(setq user-emacs-directory (file-truename (concat \"/sandbox/\" emacs-version \"/\")))" \
--eval "(setq user-init-file (file-truename (concat \"/sandbox/\" emacs-version \"/init.el\")))" \
--eval "(progn (require 'package) (package-initialize))" \
"$@"
#!/bin/bash
# * License:
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
set -eou pipefail
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
mkdir -p "$DIR/.sandbox"
exec docker run \
--mount type=bind,source="$DIR",target=/src \
--mount type=bind,source="$DIR/.sandbox",target=/sandbox \
$(docker build . --quiet) \
"$@"
# * License:
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
FROM alpine:3.13
RUN apk update && apk add --no-cache \
aspell \
aspell-en \
bash \
ca-certificates \
coreutils \
emacs \
git \
make
RUN adduser -D emacs
USER emacs
WORKDIR /src
ENTRYPOINT ["make", "sandbox=/sandbox"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment