Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .emacs.d/docker/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"dockerComposeFile": [
"../docker-compose.yml"
],
"service": "devcontainer",

"remoteUser": "ubuntu",

"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind",
"workspaceFolder": "/workspace",

"mounts": [
{
"type":"bind",
"source":"${localEnv:HOME}/.ssh",
"target":"/home/ubuntu/.ssh"
},
{
"type": "bind",
"source": "${localEnv:SSH_AUTH_SOCK}",
"target": "/ssh-agent"
}
],

"features": {
"ghcr.io/devcontainers/features/common-utils:2": {},
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {}
}
}
72 changes: 4 additions & 68 deletions .emacs.d/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,78 +1,14 @@
FROM ubuntu:22.04

ARG CLANG_VERSION=19
# syntax=docker/dockerfile:1
FROM ubuntu:24.04

# /* cspell:disable-next-line */
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update

RUN apt-get install -y tzdata

RUN apt-get install -y ubuntu-desktop

RUN apt-get install -y curl git ripgrep
RUN apt-get update && apt-get install -y tzdata ubuntu-desktop git curl wget lsb-release software-properties-common ripgrep

# cspell:disable-next-line
RUN add-apt-repository ppa:ubuntuhandbook1/emacs && \
RUN add-apt-repository ppa:ubuntuhandbook1/emacs -y && \
apt-get update

# emacs30 as of 2026/02/28
RUN apt-get install -y emacs

# for clangd
RUN apt-get update && apt-get install -y git curl wget lsb-release software-properties-common

WORKDIR /tmp

ADD --chown=root:root --chmod=777 https://apt.llvm.org/llvm.sh llvm.sh

RUN ./llvm.sh ${CLANG_VERSION}

# cSpell:disable
RUN apt-get update && apt-get install -y \
clang-${CLANG_VERSION} \
clang++-${CLANG_VERSION} \
clang-tidy-${CLANG_VERSION} \
clangd-${CLANG_VERSION} \
clang-format-${CLANG_VERSION} \
libomp-${CLANG_VERSION}-dev \
libstdc++-12-dev
# cSpell:eable

RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${CLANG_VERSION} ${CLANG_VERSION}
RUN update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${CLANG_VERSION} ${CLANG_VERSION}
RUN update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-${CLANG_VERSION} ${CLANG_VERSION}
RUN update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-${CLANG_VERSION} ${CLANG_VERSION}
RUN update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-${CLANG_VERSION} ${CLANG_VERSION}

RUN apt-get update && apt-get install -y libreadline-dev libgtest-dev libboost-all-dev

# NOTE: apt-get install cmake causes following error
# The following packages have unmet dependencies:
# emacs-pgtk : Breaks: dh-elpa-helper (< 2.1.7) but 2.0.9ubuntu1 is to be installed
# E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
# so install latest cmake
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - > /usr/share/keyrings/kitware-archive-keyring.gpg
RUN echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' > /etc/apt/sources.list.d/kitware.list
RUN apt-get update && apt-get install -y cmake

# rust
# cspell:disable-next-line
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

# python

# user
RUN useradd -m ubuntu

# setup sudo
RUN apt-get update && apt-get install -y sudo
RUN echo "ubuntu:password" | chpasswd
RUN usermod -aG sudo ubuntu

USER ubuntu

WORKDIR /home/ubuntu

CMD ["/bin/bash"]
6 changes: 0 additions & 6 deletions .emacs.d/docker/README.md

This file was deleted.

18 changes: 7 additions & 11 deletions .emacs.d/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
name: emacs-dev

services:
ubuntu:
build: .
container_name: emacs-dev
devcontainer:
build:
context: .
dockerfile: Dockerfile
container_name: dotfiles-emacs-dev-container
volumes:
- type: bind
source: "../../../dotfiles"
target: "/workspace/dotfiles"
- type: bind
source: "../../.emacs.d"
target: "/home/ubuntu/.emacs.d"
- type: bind
source: /tmp/.X11-unix
target: /tmp/.X11-unix
- type: bind
source: "../../../cpplox" # cSpell:disable-line
target: "/workspace/cpplox" # cSpell:disable-line
source: "../../"
target: "/workspace"
environment:
DISPLAY: $DISPLAY
tty: true
working_dir: /workspace
7 changes: 0 additions & 7 deletions .emacs.d/emacs-custom.el

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ __pycache__
compile_commands.json
.envrc
.config/fish/conf.d/rustup.fish
devcontainer-lock.json
.emacs.d/emacs-custom.el
2 changes: 1 addition & 1 deletion ansible/playbook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
- role: system_tools
- role: terminal
tags: [not_for_wsl]
- role: editor
- role: emacs
- role: dev_tools
- role: fonts
- role: gui_tools
Expand Down
30 changes: 13 additions & 17 deletions docs/cpp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
FROM ubuntu:22.04
# syntax=docker/dockerfile:1
FROM ubuntu:24.04

# 18だとlspで関数の引数リストのsnippetが上手く出ないかも
ARG CLANG_VERSION=19
ENV CC=clang
ENV CXX=clang++

RUN apt-get update && apt-get install -y git curl wget lsb-release software-properties-common

WORKDIR /tmp

ADD --chown=root:root --chmod=777 https://apt.llvm.org/llvm.sh llvm.sh
ARG CLANG_VERSION=18
ARG LIB_STDCPP_VERSION=13

RUN ./llvm.sh ${CLANG_VERSION}
RUN apt-get update && apt-get install -y git curl wget lsb-release software-properties-common

RUN apt-get update && apt-get install -y \
clang-${CLANG_VERSION} \
Expand All @@ -18,12 +16,10 @@ RUN apt-get update && apt-get install -y \
clangd-${CLANG_VERSION} \
clang-format-${CLANG_VERSION} \
libomp-${CLANG_VERSION}-dev \
libstdc++-12-dev

RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 18
RUN update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 18
RUN update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-18 18
RUN update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-18 18
RUN update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-18 18
libstdc++-${LIB_STDCPP_VERSION}-dev

WORKDIR /workspaces/
RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${CLANG_VERSION} ${CLANG_VERSION}
RUN update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${CLANG_VERSION} ${CLANG_VERSION}
RUN update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-${CLANG_VERSION} ${CLANG_VERSION}
RUN update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-${CLANG_VERSION} ${CLANG_VERSION}
RUN update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-${CLANG_VERSION} ${CLANG_VERSION}
Loading