Skip to content

Commit

Permalink
Added another dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
felixbd committed Sep 18, 2024
1 parent 8953f18 commit d5a3b16
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 18 deletions.
33 changes: 19 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,41 @@
# TODO: hadolint Dockerfile
# warning: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`

# Use the latest stable Debian image 12.7
FROM debian:12.7

LABEL org.opencontainers.image.description DOOM-EMACS-IN-DOCKER

# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV PATH="/home/emacsuser/.config/emacs/bin:${PATH}"

# Install dependencies
# Install dependencies and Create a non-root user
RUN apt-get update && \
apt-get install -y --no-install-recommends apt-utils ca-certificates && \
apt-get install -y --no-install-recommends emacs git curl sudo gcc ripgrep fd-find \
libgccjit0 libgccjit-12-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/*

# Create a non-root user
RUN useradd -ms /bin/bash emacsuser && \
apt-get install -y --no-install-recommends \
apt-utils=2.6.1 \
ca-certificates=20230311 && \
apt-get install -y --no-install-recommends \
curl=7.88.1-10+deb12u7 \
emacs=1:28.2+1-15+deb12u3 \
fd-find=8.6.0-3 \
gcc=4:12.2.0-3 \
git=1:2.39.5-0+deb12u1 \
ripgrep=13.0.0-4+b2 \
sudo=1.9.13p3-1+deb12u1 \
libgccjit-12-dev=12.2.0-14 \
libgccjit0=12.2.0-14 && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
useradd -ms /bin/bash emacsuser && \
echo "emacsuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

# Switch to the non-root user and set up Doom Emacs
USER emacsuser
WORKDIR /home/emacsuser

# Install Doom Emacs
RUN git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs && \
RUN git clone --depth 1 https://github.com/doomemacs/doomemacs.git ~/.config/emacs && \
~/.config/emacs/bin/doom install --env -! && \
mkdir -p ~/.config/emacs/doom/old-config && \
find ~/.config/emacs/doom/ -maxdepth 1 -name '*.el' -exec mv {} ~/.config/emacs/doom/old-config/ \;

# mv ~/.config/emacs/doom/*.el ~/.config/emacs/doom/old-config/

# Copy Doom Emacs config files and update
COPY ./doom-snapshot/*.el /home/emacsuser/.config/doom/
RUN doom upgrade && doom sync
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@

run:
sudo docker run --rm -it -u $(id -u):$(id -g) \
-v "`pwd`":/app --workdir /app \
ghcr.io/felixbd/doom-docker:master


build:
sh doom-config-snapshot.sh

Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ sudo docker run --rm -it -u $(id -u):$(id -g) \
ghcr.io/felixbd/doom-docker:master
```

> TODO:
> To provide a description, add the following line to your Dockerfile:
> `LABEL org.opencontainers.image.description DESCRIPTION`
</br>
</br>

Expand Down

0 comments on commit d5a3b16

Please sign in to comment.