3 Star 5 Fork 1

Gitee 极速下载/cloudmacs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/karlicoss/cloudmacs
克隆/下载
Dockerfile 2.12 KB
一键复制 编辑 原始数据 按行查看 历史
sarab 提交于 2023-04-02 11:33 +08:00 . Fix gotty to be compatible with latest image
FROM silex/emacs:master-alpine AS emacs
# TODO 218 Mb. hmm wonder if building without GUI would help?
### configure locales for proper unicode display
# Borrowed from https://gist.github.com/Herz3h/0ffc2198cb63949a20ef61c1d2086cc0
# TODO add other locales..
ENV MUSL_LOCPATH=/usr/local/share/i18n/locales/musl
RUN apk --no-cache add git cmake make musl-dev gcc gettext-dev libintl \
&& git clone https://github.com/rilian-la-te/musl-locales.git /tmp/musl-locales \
&& cd /tmp/musl-locales \
&& cmake . && make && make install \
&& rm -rf /tmp/musl-locales \
&& apk del git cmake make musl-dev gcc gettext-dev libintl
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
###
### configure gotty
# TODO extract in a separate image?
# based on https://github.com/dit4c/dockerfile-gotty
# Unfortunately, it's got fixed alpine version and missing dependency so easiest was just to copy it
RUN apk add --no-cache go git build-base && \
mkdir -p /tmp/gotty && \
GOPATH=/tmp/gotty go get github.com/sorenisanerd/gotty && \
mv /tmp/gotty/bin/gotty /usr/local/bin/ && \
apk del go git build-base && \
rm -rf /tmp/gotty
# binary takes about 14 Mb
###
### configure asEnvUser, tool to run emacs in docker with user's permissions rather than root
# borrowed from https://github.com/JAremko/docker-emacs/blob/master/Dockerfile.alpine
COPY asEnvUser /usr/local/sbin/
# only allow root to run it
RUN chown root /usr/local/sbin/asEnvUser \
&& chmod 700 /usr/local/sbin/asEnvUser
# su-exec
RUN apk --no-cache add git build-base bash \
&& git clone https://github.com/ncopa/su-exec.git /tmp/su-exec \
&& cd /tmp/su-exec \
&& make \
&& chmod 770 su-exec \
&& mv ./su-exec /usr/local/sbin/ \
&& apk del git build-base
###
ENV WORKSPACE="/mnt/workspace" \
SHELL="/bin/bash"
# gotty default
EXPOSE 8080
WORKDIR "${WORKSPACE}"
ENTRYPOINT ["asEnvUser"]
# -a options connects to existing emacs session or starts a new one if there is no Emacs running
# see https://www.gnu.org/software/emacs/manual/html_node/emacs/emacsclient-Options.html
CMD ["gotty", "--permit-write", "--reconnect", "emacsclient", "--tty", "-a", "emacs"]
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/mirrors/cloudmacs.git
git@gitee.com:mirrors/cloudmacs.git
mirrors
cloudmacs
cloudmacs
master

搜索帮助