Skip to content

Commit f5db797

Browse files
committed
Add lazygit to default install of devcontainer template
Can be simplified to an apt install once upgrading to at least a 25.10 base image
1 parent 47dcc42 commit f5db797

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,16 @@ FROM ghcr.io/diamondlightsource/ubuntu-devcontainer:noble AS developer
66
RUN apt-get update -y && apt-get install -y --no-install-recommends \
77
graphviz \
88
&& apt-get dist-clean
9+
10+
# Can replace with "apt install lazygit" when Ubuntu >= 25.10
11+
# Download and install latest lazygit binary
12+
RUN LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" \
13+
| grep -Po '"tag_name": "v\K[^"]*') \
14+
&& echo "Installing lazygit version: $LAZYGIT_VERSION" \
15+
&& curl -Lo lazygit.tar.gz \
16+
"https://github.com/jesseduffield/lazygit/releases/download/v${LAZYGIT_VERSION}/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz" \
17+
&& tar xf lazygit.tar.gz lazygit \
18+
&& install lazygit /usr/local/bin
19+
20+
# Cleanup
21+
RUN rm lazygit.tar.gz lazygit

template/Dockerfile.jinja

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends \
77
graphviz \
88
&& apt-get dist-clean{% if docker %}
99

10+
# Can replace with "apt install lazygit" when Ubuntu >= 25.10
11+
# Download and install latest lazygit binary
12+
RUN LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" \
13+
| grep -Po '"tag_name": "v\K[^"]*') \
14+
&& echo "Installing lazygit version: $LAZYGIT_VERSION" \
15+
&& curl -Lo lazygit.tar.gz \
16+
"https://github.com/jesseduffield/lazygit/releases/download/v${LAZYGIT_VERSION}/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz" \
17+
&& tar xf lazygit.tar.gz lazygit \
18+
&& install lazygit /usr/local/bin
19+
20+
# Cleanup
21+
RUN rm lazygit.tar.gz lazygit
22+
23+
1024
# The build stage installs the context into the venv
1125
FROM developer AS build
1226

0 commit comments

Comments
 (0)