Skip to content

Commit 9998769

Browse files
committed
Add Docker to rails-app
1 parent 87dd7ae commit 9998769

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

Linux/compose.override.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
services:
44
web:
5+
group_add:
6+
- "140"
57
volumes:
68
- ~/.gitconfig:/home/dev/.gitconfig
79
# - /etc/passwd:/etc/passwd:ro

rails-app/Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,24 @@ RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg -
2121

2222
RUN apt-get update && apt-get install libvips-dev -y -q --no-install-recommends && apt-get clean && rm -rf /var/lib/apt/lists/*
2323

24+
# The following is so part of what we need to run `kamal deploy` inside the container. Rafael says running
25+
# Kamal inside the container is the intended use.
26+
# You need to have the Docker executables in the container, plus the right volume mounts and permissions
27+
# in `compose.yml` or `compose.override.yml` so the executables can use the Docker engine running on the host.
28+
# All this sounds like it's very *nix-specific.
29+
RUN apt-get update && \
30+
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc && \
31+
chmod a+r /etc/apt/keyrings/docker.asc && \
32+
echo \
33+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
34+
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" > /etc/apt/sources.list.d/docker.list && \
35+
apt-get update && \
36+
apt-get install docker-buildx-plugin -y -q --no-install-recommends && \
37+
apt-get update && \
38+
apt-get install docker-ce-cli -y -q --no-install-recommends && \
39+
apt-get clean && \
40+
rm -rf /var/lib/apt/lists/*
41+
2442
# `rails-app` is useful for other things, like Jekyll, so let's install foreman as well.
2543
# Rails needs it anyway, at least in some configurations, so this saves an install on-the-fly.
2644
USER dev

0 commit comments

Comments
 (0)