Skip to content

Commit

Permalink
personal docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
neox101 committed Dec 23, 2024
0 parents commit acdd31d
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -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
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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" ]
36 changes: 36 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
@@ -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


24 changes: 24 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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 <<EOF
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(package-initialize)
EOF
emacs -batch -l /tmp/melpa.el -f package-refresh-contents
rm -f /tmp/melpa.el
fi

exec "$@"
23 changes: 23 additions & 0 deletions init.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

;; this file is user-init-file
(setq user-init-file (or load-file-name (buffer-file-name)))
;; user-emacs-directory is defined in subr.el , which is same as this.
(setq user-emacs-directory (file-name-directory user-init-file))


(require 'package)

(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))

(package-initialize)

(let ((packages (getenv "EMACS_PACKAGES")))
(when packages
(dolist (package (split-string packages))
(add-to-list 'package-selected-packages (intern package)))))

(package-install-selected-packages)
(message "Hello")

(eval-after-load "ox-html" (setq org-html-prefer-user-labels t))
(message "Hello World")

0 comments on commit acdd31d

Please # to comment.