Skip to content

Commit 6190bbc

Browse files
committed
docker: add Dockerfile dev env
Yes, it's 1.5GB. It's node's fault, not mine.
1 parent ad8c59c commit 6190bbc

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

Dockerfile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
FROM ruby:3.2.2-slim-bookworm
2+
3+
RUN apt update && \
4+
apt --yes upgrade && \
5+
apt --yes install build-essential curl procps git \
6+
fonts-liberation libasound2 \
7+
libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 \
8+
libfontconfig1 libgbm1 libgcc1 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 \
9+
libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 \
10+
libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \
11+
--no-install-recommends && \
12+
rm -rf /var/lib/apt/lists/*
13+
14+
ARG UID=1000
15+
ARG GID=1000
16+
17+
WORKDIR /srv/
18+
COPY Gemfile /srv/Gemfile
19+
20+
RUN groupadd -g ${GID} docs && \
21+
useradd -m -u ${UID} -g docs -s /bin/bash docs
22+
RUN chown -R docs:docs /srv/
23+
USER docs
24+
25+
RUN bash -l -c "echo 'export GEM_HOME=${HOME}/.gem' >> ${HOME}/.bashrc \
26+
&& echo 'export GEM_PATH=${HOME}/.gem' >> ${HOME}/.bashrc \
27+
&& source ~/.bashrc \
28+
&& bundle config set --local path ${HOME}/.gem \
29+
&& bundle install"
30+
31+
RUN bash -l -c "curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash \
32+
&& export NVM_DIR=\"\$([ -z \"${XDG_CONFIG_HOME-}\" ] && printf %s \"${HOME}/.nvm\" || printf %s \"${XDG_CONFIG_HOME}/nvm\")\" \
33+
&& [ -s \"\$NVM_DIR/nvm.sh\" ] && \\. \"\$NVM_DIR/nvm.sh\" \
34+
&& echo 'export PATH=${PATH}:/srv/node_modules/.bin' >> ${HOME}/.bashrc \
35+
&& source ~/.bashrc \
36+
&& nvm install node \
37+
&& npm install @mermaid-js/mermaid-cli"
38+
39+
ENV LANG C.UTF-8
40+
ENV LC_ALL C.UTF-8
41+
ENTRYPOINT ["bash", "-l"]

jekyll_workflow.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,18 @@ id=$( podman run --cap-add NET_ADMIN --cap-add NET_RAW --detach -v $REPO:/srv/ -
3232
podman attach $id
3333
```
3434

35+
Or for Docker:
3536

37+
```
38+
REPO=~/repos/onboarding-to-bitcoin-core/
39+
40+
# docker build
41+
docker build -f $REPO/Dockerfile -t guide $REPO
42+
# or with docker buildx
43+
docker build --load -f $REPO/Dockerfile -t guide $REPO
3644
45+
id=$( docker run --detach -v $REPO:/srv/ -p 8080:4000 -it guide:latest )
46+
docker attach $id
47+
48+
bundle install # shouldn't be needed after Dockerfile build, but it is...
49+
```

0 commit comments

Comments
 (0)