From acdd31de7f3ee8533b6e6f0ebbc9efecdb9dec5e Mon Sep 17 00:00:00 2001 From: neo101 Date: Mon, 23 Dec 2024 18:35:25 +0530 Subject: [PATCH] personal docker image --- .github/workflows/docker-image.yml | 23 +++++++++++++++++++ Dockerfile | 36 ++++++++++++++++++++++++++++++ README.org | 36 ++++++++++++++++++++++++++++++ entrypoint.sh | 24 ++++++++++++++++++++ init.el | 23 +++++++++++++++++++ 5 files changed, 142 insertions(+) create mode 100644 .github/workflows/docker-image.yml create mode 100644 Dockerfile create mode 100644 README.org create mode 100644 entrypoint.sh create mode 100644 init.el diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..0c4cce9 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,23 @@ + +name: Docker Image CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "neox101" --password-stdin + docker build . --file Dockerfile --tag neox101/emacs-image:v1 + echo "Build Success!" + docker push neox101/emacs-image:v1 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..26ca496 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,36 @@ + +FROM alpine:3.14 + +MAINTAINER Iku Iwasa "iku.iwasa@gmail.com" + +RUN apk update && apk upgrade + +RUN apk add ca-certificates + +RUN apk add gcc make g++ zlib-dev + +RUN apk search sqlite + +RUN apk add sqlite + +RUN apk add coreutils + +RUN apk add gnupg + +RUN apk add rclone + +RUN apk add git + +RUN apk add emacs +RUN /usr/bin/emacs --version || true + +# create .emacs.d +WORKDIR /root +RUN mkdir /root/.emacs.d/ +COPY init.el /root/.emacs.d/ +RUN ls /root/.emacs.d/ +COPY --chmod=777 entrypoint.sh / +COPY publish.tar.gpg /root/ + +ENTRYPOINT [ "/entrypoint.sh" ] +CMD [ "emacs" ] diff --git a/README.org b/README.org new file mode 100644 index 0000000..1bbc525 --- /dev/null +++ b/README.org @@ -0,0 +1,36 @@ + +* Docker image for Emacs on Alpine Linux +Docker image: [[https://hub.docker.com/repository/docker/neox101/emacs-image/builds][Docker Build]] + +Emacs from Alpine community repository with MELPA setting. + +- Alpine Linux v3.11 +- Emacs v26.3 + +* How to use this image +#+begin_src sh +docker run -it iquiw/alpine-emacs +#+end_src + + +* Environment Variables + +** `EMACS_PACKAGES` + +This variable specifies space separated list of packages. +They are installed automatically when the container is executed. + + +* Favicon +Get free favicon from: +https://www.favicon.cc + + +* Build on docker +Go to : +and click on Trigger. + +* REF: +https://github.com/iquiw/docker-alpine-emacs + + diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..00fc53a --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,24 @@ +#! /bin/sh + +EMACS_DIR=$HOME/.emacs.d/ +EMACS_ELPA_DIR=$EMACS_DIR/elpa/ +EMACS_INIT_FILE=$EMACS_DIR/init.el + +echo "inside entry point." + +which git +ls -lrt /usr/bin/ +ls -lrt /usr/share/ +# which emacs + +if [ "$1" = emacs -a ! -d "$EMACS_ELPA_DIR" -a -n "$EMACS_PACKAGES" ]; then + cat > /tmp/melpa.el <