1+ # syntax=docker/dockerfile:1
2+
13# #######
24# Base #
35# #######
46
5- FROM debian:bookworm -slim
7+ FROM debian:trixie -slim
68
79ARG DEBIAN_FRONTEND="noninteractive"
810
911ARG MANALA_USER_ID="1000"
1012ARG MANALA_GROUP_ID="1000"
1113
12- ARG GOSU_VERSION="1.17"
13- ARG GOMPLATE_VERSION="4.1.0"
14- ARG DIRENV_VERSION="2.34.0"
14+ ARG GOMPLATE_VERSION="4.3.3"
15+ ARG DIRENV_VERSION="2.37.1"
1516ARG JQ_VERSION="1.7.1"
16- ARG YQ_VERSION="4.44.3"
17+ ARG YQ_VERSION="4.48.1"
18+ ARG STARSHIP_VERSION="1.24.0"
19+ ARG FZF_VERSION="0.66.1"
1720
1821# The 'container' environment variable tells systemd that it's running inside a
1922# Docker container environment.
2023# It's also internally used for checking we're running inside a container.
2124ENV container="docker"
2225
23- # Default locale
24- ENV LANG="C.UTF-8"
25-
26- SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
27-
28- RUN \
29- apt-get --quiet update \
30- && apt-get --quiet --yes --purge --autoremove upgrade \
31- && apt-get --quiet --yes --no-install-recommends --verbose-versions install \
32- bash-completion \
33- bzip2 \
34- ca-certificates \
35- curl \
36- git \
37- gnupg \
38- less \
39- libarchive-tools \
40- make \
41- rsync \
42- s6 \
43- socat \
44- sudo \
45- vim \
46- # User
47- && addgroup --gid ${MANALA_GROUP_ID} lazy \
48- && adduser --home /home/lazy --shell /bin/bash --uid ${MANALA_USER_ID} --gecos lazy --ingroup lazy --disabled-password lazy \
49- && install --verbose --mode 0755 --group lazy --owner lazy --directory /run/user/${MANALA_USER_ID} \
50- && echo "lazy ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/lazy \
51- # Gosu
52- && curl -sSLf "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$(case $(dpkg --print-architecture) in " amd64") echo " amd64" ;; " arm64") echo " arm64" ;; esac)" \
53- --output /usr/local/bin/gosu \
54- && chmod +x /usr/local/bin/gosu \
55- # Gomplate
56- && curl -sSLf "https://github.com/hairyhenderson/gomplate/releases/download/v${GOMPLATE_VERSION}/gomplate_linux-$(case $(dpkg --print-architecture) in " amd64") echo " amd64" ;; " arm64") echo " arm64" ;; esac)" \
57- --output /usr/local/bin/gomplate \
58- && chmod +x /usr/local/bin/gomplate \
59- # Direnv
60- && curl -sSLf "https://github.com/direnv/direnv/releases/download/v${DIRENV_VERSION}/direnv.linux-$(case $(dpkg --print-architecture) in " amd64") echo " amd64" ;; " arm64") echo " arm64" ;; esac)" \
61- --output /usr/local/bin/direnv \
62- && chmod +x /usr/local/bin/direnv \
63- # Jq
64- && curl -sSLf "https://github.com/jqlang/jq/releases/download/jq-${JQ_VERSION}/jq-linux-$(case $(dpkg --print-architecture) in " amd64") echo " amd64" ;; " arm64") echo " arm64" ;; esac)" \
65- --output /usr/local/bin/jq \
66- && chmod +x /usr/local/bin/jq \
67- # Yq
68- && curl -sSLf "https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_$(case $(dpkg --print-architecture) in " amd64") echo " amd64" ;; " arm64") echo " arm64" ;; esac)" \
69- --output /usr/local/bin/yq \
70- && chmod +x /usr/local/bin/yq \
71- # Bash completion
72- && install --verbose --mode 0755 --directory /etc/bash_completion.d \
73- # Oh My Bash
74- && git clone https://github.com/ohmybash/oh-my-bash.git /usr/local/share/oh-my-bash \
75- # Clean
76- && rm -rf /var/lib/apt/lists/*
26+ # Starship
27+ ENV STARSHIP_CONFIG=/etc/starship/starship.toml
28+
29+ SHELL ["/bin/bash" , "-e" , "-o" , "pipefail" , "-c" ]
30+
31+ RUN <<EOF
32+ # Packages
33+ apt-get --quiet update
34+ apt-get --quiet --yes --purge --autoremove upgrade
35+ apt-get --quiet --yes --no-install-recommends --verbose-versions install \
36+ bzip2 \
37+ ca-certificates \
38+ curl \
39+ git \
40+ gnupg \
41+ gosu \
42+ less \
43+ libarchive-tools \
44+ make \
45+ rsync \
46+ s6 \
47+ socat \
48+ sudo \
49+ vim \
50+ zsh
51+ # Locale
52+ apt-get --quiet --yes --no-install-recommends --verbose-versions install \
53+ locales
54+ sed -i "/^# *en_US.UTF-8\b /s/^# *//" /etc/locale.gen
55+ dpkg-reconfigure locales
56+ # User
57+ addgroup --gid ${MANALA_GROUP_ID} lazy
58+ adduser --home /home/lazy --shell /bin/zsh --uid ${MANALA_USER_ID} --gecos lazy --ingroup lazy --disabled-password lazy
59+ install --verbose --mode 0755 --group lazy --owner lazy --directory /run/user/${MANALA_USER_ID}
60+ echo "lazy ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/lazy
61+ # Gomplate
62+ curl -sSLf "https://github.com/hairyhenderson/gomplate/releases/download/v${GOMPLATE_VERSION}/gomplate_linux-$(case $(dpkg --print-architecture) in " amd64") echo " amd64" ;; " arm64") echo " arm64" ;; esac)" \
63+ --output /usr/local/bin/gomplate
64+ chmod +x /usr/local/bin/gomplate
65+ # Direnv
66+ curl -sSLf "https://github.com/direnv/direnv/releases/download/v${DIRENV_VERSION}/direnv.linux-$(case $(dpkg --print-architecture) in " amd64") echo " amd64" ;; " arm64") echo " arm64" ;; esac)" \
67+ --output /usr/local/bin/direnv
68+ chmod +x /usr/local/bin/direnv
69+ # Jq
70+ curl -sSLf "https://github.com/jqlang/jq/releases/download/jq-${JQ_VERSION}/jq-linux-$(case $(dpkg --print-architecture) in " amd64") echo " amd64" ;; " arm64") echo " arm64" ;; esac)" \
71+ --output /usr/local/bin/jq
72+ chmod +x /usr/local/bin/jq
73+ # Yq
74+ curl -sSLf "https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_$(case $(dpkg --print-architecture) in " amd64") echo " amd64" ;; " arm64") echo " arm64" ;; esac)" \
75+ --output /usr/local/bin/yq
76+ chmod +x /usr/local/bin/yq
77+ # Oh My Zsh
78+ git clone https://github.com/ohmyzsh/ohmyzsh.git /usr/local/share/oh-my-zsh
79+ # See: https://github.com/ohmyzsh/ohmyzsh/issues/11995
80+ git clone https://github.com/zsh-users/zsh-autosuggestions.git /usr/local/share/oh-my-zsh/custom/plugins/zsh-autosuggestions
81+ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git /usr/local/share/oh-my-zsh/custom/plugins/zsh-syntax-highlighting
82+ echo "ZDOTDIR=/etc/zsh" > /etc/zsh/zshenv
83+ # Starship
84+ curl -sSLf "https://github.com/starship/starship/releases/download/v${STARSHIP_VERSION}/starship-$(case $(dpkg --print-architecture) in " amd64") echo " x86_64" ;; " arm64") echo " aarch64" ;; esac)-unknown-linux-musl.tar.gz" \
85+ | bsdtar -xvf - -C /usr/local/bin
86+ echo "Defaults env_keep += STARSHIP_CONFIG" > /etc/sudoers.d/starship
87+ # Fzf
88+ curl -sSLf "https://github.com/junegunn/fzf/releases/download/v${FZF_VERSION}/fzf-${FZF_VERSION}-linux_$(case $(dpkg --print-architecture) in " amd64") echo " amd64" ;; " arm64") echo " arm64" ;; esac).tar.gz" \
89+ | bsdtar -xvf - -C /usr/local/bin
90+ chmod +x /usr/local/bin/fzf
91+ # Clean
92+ rm -rf /var/lib/apt/lists/*
93+ EOF
94+
95+ # Locale
96+ ENV LANG="en_US.UTF-8"
7797
7898# #########
7999# System #
@@ -82,43 +102,49 @@ RUN \
82102ENV PIPX_HOME="/usr/local/pipx"
83103ENV PIPX_BIN_DIR="/usr/local/bin"
84104
85- RUN \
86- apt-get --quiet update \
87- && apt-get --quiet --yes --no-install-recommends --verbose-versions install \
88- openssh-client \
89- pipx \
90- python3 \
91- python3-argcomplete \
92- shellcheck \
93- sshpass \
94- # Sudo
95- && echo "Defaults env_keep += \" PIPX_*\" " > /etc/sudoers.d/pipx \
96- # Bash completion
97- && activate-global-python-argcomplete --dest /etc/bash_completion.d \
98- # Clean
99- && rm -rf /var/lib/apt/lists/*
105+ RUN <<EOF
106+ apt-get --quiet update
107+ apt-get --quiet --yes --no-install-recommends --verbose-versions install \
108+ openssh-client \
109+ pipx \
110+ python3 \
111+ shellcheck \
112+ sshpass
113+ # Sudo
114+ echo "Defaults env_keep += \" PIPX_*\" " > /etc/sudoers.d/pipx
115+ # Clean
116+ rm -rf /var/lib/apt/lists/*
117+ EOF
100118
101119# Ansible
102- RUN \
103- pipx install --pip-args="--no-cache-dir" \
104- ansible-core==2.16.9
120+ RUN <<EOF
121+ pipx install --pip-args="--no-cache-dir" \
122+ ansible-core==2.18.9
123+ EOF
105124
106125# Ansible Lint
107- RUN \
108- BUILD_PACKAGES=( \
109- libpython3-dev gcc \
110- ) \
111- && apt-get --quiet update \
112- && apt-get --quiet --yes --no-install-recommends --verbose-versions install \
113- "${BUILD_PACKAGES[@]}" \
114- && pipx install --pip-args="--no-cache-dir" \
115- ansible-lint==24.7.0 \
116- # Clean
117- && apt-get --quiet --yes --autoremove purge \
118- "${BUILD_PACKAGES[@]}" \
119- && rm -rf /var/lib/apt/lists/*
126+ RUN <<EOF
127+ BUILD_PACKAGES=( \
128+ libpython3-dev gcc \
129+ )
130+ apt-get --quiet update
131+ apt-get --quiet --yes --no-install-recommends --verbose-versions install \
132+ "${BUILD_PACKAGES[@]}"
133+ pipx install --pip-args="--no-cache-dir" \
134+ ansible-lint[lock]==25.9.1
135+ # Clean
136+ apt-get --quiet --yes --autoremove purge \
137+ "${BUILD_PACKAGES[@]}"
138+ rm -rf /var/lib/apt/lists/*
139+ EOF
140+
141+ # Ansible Creator
142+ RUN <<EOF
143+ pipx install --pip-args="--no-cache-dir" \
144+ ansible-creator==25.9.0
145+ EOF
120146
121147# Run
122148COPY docker/entrypoint.sh /
123149ENTRYPOINT ["/entrypoint.sh" ]
124- CMD ["bash " ]
150+ CMD ["zsh " ]
0 commit comments