Last active
July 9, 2021 11:10
-
-
Save jscheid/84af350a6115067c92c0181cbb94810b to your computer and use it in GitHub Desktop.
Running makem in Docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dockerfile | |
/.sandbox/ | |
/.git/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/.sandbox/ | |
*.elc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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))" \ | |
"$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) \ | |
"$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# * 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
To use this, add these files alongside
makem.sh
andMakefile
. Then, cd to the directory and use e.g../dmake lint
to run a makem command, or./demacs
to run Emacs inside Docker.