File tree Expand file tree Collapse file tree 4 files changed +70
-4
lines changed
Expand file tree Collapse file tree 4 files changed +70
-4
lines changed Original file line number Diff line number Diff line change 1- FROM node:22-alpine
1+ FROM node:22-bookworm
22
3- RUN apk add --update tini && npm install -g cline
3+ RUN apt-get update && apt-get install -y --no-install-recommends \
4+ bash \
5+ ca-certificates \
6+ curl \
7+ gosu \
8+ tini \
9+ && rm -rf /var/lib/apt/lists/*
410
5- ENTRYPOINT ["/sbin/tini" , "--" ]
11+ # Install docker-cli
12+ RUN curl -fsSL https://download.docker.com/linux/debian/dists/bookworm/pool/stable/amd64/docker-ce-cli_29.1.3-1~debian.12~bookworm_amd64.deb -o /tmp/docker-ce-cli.deb \
13+ && dpkg -i /tmp/docker-ce-cli.deb \
14+ && rm /tmp/docker-ce-cli.deb \
15+ && npm install -g cline
16+
17+ RUN usermod -l cline -d /home/cline -m node \
18+ && groupmod -n cline node \
19+ && groupadd docker \
20+ && usermod -aG docker cline
21+
22+ COPY entrypoint.sh /usr/local/bin/entrypoint.sh
23+
24+ ENTRYPOINT ["/usr/bin/tini" , "--" , "/usr/local/bin/entrypoint.sh" ]
625
726CMD ["cline" ]
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ set -e
4+
5+ # https://stackoverflow.com/a/687052
6+ tmpdir=" $( mktemp -d) "
7+ trap ' rm -rf -- "$tmpdir"' EXIT
8+
9+
10+ cat << EOF > "${tmpdir} /Dockerfile"
11+ # You can customize image here.
12+ FROM rophy/cline-cli:20260108-r1
13+ EOF
14+
15+ docker build -t cline " ${tmpdir} "
16+
17+ HOST_UID=$( id -u)
18+ HOST_GID=$( id -g)
19+ DOCKER_GID=$( getent group docker | cut -d: -f3)
20+ WORKDIR=$( pwd)
21+
22+ docker run --rm -it \
23+ -e HOST_UID=${HOST_UID} \
24+ -e HOST_GID=${HOST_GID} \
25+ -e DOCKER_GID=${DOCKER_GID} \
26+ -v " /var/run/docker.sock:/var/run/docker.sock:ro" \
27+ -v " ${HOME} :/home/cline" \
28+ -v " ${WORKDIR} :${WORKDIR} " \
29+ --workdir=" ${WORKDIR} " \
30+ cline
31+
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ set -e
4+
5+ # Define desired UID and GID from environment variable, defaults to 1000:1000.
6+ HOST_UID=${HOST_UID:- 1000}
7+ HOST_GID=${HOST_GID:- 1000}
8+ DOCKER_GID=${DOCKER_GID:- 999}
9+ TARGET_USER=" cline"
10+
11+ groupmod --gid ${HOST_GID} ${TARGET_USER}
12+ usermod --uid ${HOST_UID} --gid ${HOST_GID} ${TARGET_USER}
13+ groupmod -g ${DOCKER_GID} docker
14+
15+ exec gosu ${TARGET_USER} " $@ "
16+
Original file line number Diff line number Diff line change 1- 20251206 -r1
1+ 20260108 -r1
You can’t perform that action at this time.
0 commit comments