Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions containers/base/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -163,27 +163,23 @@ RUN mkdir -m 755 $SHELL_CONFIG_DIR \
# let's you quickly see if you are inside the container or not.
RUN sed -i 's;PS1.*\\h;&*;' /root/.bashrc $DEV_USER_HOME/.bashrc

# Enable GPG agent by adding GPG_TTY
RUN { \
echo; \
echo "# Set this for gpg-agent"; \
echo "export GPG_TTY=\$(tty)"; \
} >> $DEV_USER_HOME/.bashrc

# Create directory for entry point scripts
ENV ENTRYPOINT_DIR="/etc/entrypoint.d"
RUN mkdir -m 755 $ENTRYPOINT_DIR

# Add ~/.bashrc.d support to the user's ~/.bashrc
COPY bashrcd_fragment.bash /tmp/bashrcd_fragment.bash
RUN cat /tmp/bashrcd_fragment.bash >> $DEV_USER_HOME/.bashrc \
&& sudo -u $DEV_USER mkdir -m 755 $DEV_USER_HOME/.bashrc.d

# Copy the entry point script, login shim, etc
COPY entrypoint.sh /entrypoint.sh
COPY entrypoint.d/fix_user.sh $ENTRYPOINT_DIR/10_fix_user.sh
COPY entrypoint.d/login_shim.sh $ENTRYPOINT_DIR/11_login_shim.sh
COPY entrypoint.d/shell_init.sh $ENTRYPOINT_DIR/14_shell_init.sh

# Add ~/.bashrc.d support to the user's ~/.bashrc
COPY bashrcd_fragment.bash /tmp/bashrcd_fragment.bash
RUN cat /tmp/bashrcd_fragment.bash >> $DEV_USER_HOME/.bashrc \
&& sudo -u $DEV_USER mkdir -m 755 $DEV_USER_HOME/.bashrc.d
# Copy the GPG setup, etc
COPY --chown=$DEV_USER bashrc.d/gpg_setup.bash $DEV_USER_HOME/.bashrc.d/10_gpg_setup.bash

# Here we set the entry point to the main entry point script. This script in
# turn execs a chain of other entry points. This allows other images to layer
Expand Down
7 changes: 7 additions & 0 deletions containers/base/bashrc.d/gpg_setup.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright (c) 2026 Tim Perkins

# NOTE This script is expected to be sourced!

# Set this for gpg-agent
export GPG_TTY
GPG_TTY=$(tty)
14 changes: 3 additions & 11 deletions containers/emacs/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -113,20 +113,12 @@ RUN mkdir -p $(dirname $DE_NERDFONT_FILE) \
&& curl -fL -o $DE_NERDFONT_FILE "$DE_NERDFONT_URL" \
&& fc-cache -f

# Add VTerm integration to Bash config
RUN { \
echo; \
echo "# When using VTerm, include the Bash integration"; \
echo "if [ \"\${INSIDE_EMACS}\" = \"vterm\" \\"; \
echo " -a -n \"\${EMACS_VTERM_PATH}\" \\"; \
echo " -a -f \"\${EMACS_VTERM_PATH}/etc/emacs-vterm-bash.sh\" ]; then"; \
echo " source \"\${EMACS_VTERM_PATH}/etc/emacs-vterm-bash.sh\""; \
echo "fi"; \
} >> $DEV_USER_HOME/.bashrc

# Copy entry point for config initialization
COPY entrypoint.d/emacs_init.sh $ENTRYPOINT_DIR/80_emacs_init.sh

# Add VTerm integration to Bash config
COPY --chown=$DEV_USER bashrc.d/emacs_setup.bash $DEV_USER_HOME/.bashrc.d/80_emacs_setup.bash

# Persistent storage for the Emacs and Doom config directories. These
# directories will be initialized with the Doom files from above.
VOLUME ["$EMACS_CONFIG_DIR", "$DOOM_CONFIG_DIR"]
Expand Down
9 changes: 9 additions & 0 deletions containers/emacs/bashrc.d/emacs_setup.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2026 Tim Perkins

# NOTE This script is expected to be sourced!

# When using VTerm, include the Bash integration
if [ "${INSIDE_EMACS}" = "vterm" -a -n "${EMACS_VTERM_PATH}" \
-a -f "${EMACS_VTERM_PATH}/etc/emacs-vterm-bash.sh" ]; then
source "${EMACS_VTERM_PATH}/etc/emacs-vterm-bash.sh"
fi
11 changes: 3 additions & 8 deletions containers/python/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,9 @@ RUN pipx install --global \
tox \
uv

# Enable Poetry autocompletion
RUN poetry completions bash > $DEV_USER_HOME/.bashrc_poetry \
&& { \
echo; \
echo "# Source Poetry autocompletion"; \
echo "source \"\$HOME/.bashrc_poetry\""; \
} >> $DEV_USER_HOME/.bashrc

# Switch to non-root user
USER $DEV_USER
WORKDIR $DEV_USER_HOME

# Enable Poetry autocompletion
RUN poetry completions bash > $DEV_USER_HOME/.bashrc.d/21_python_poetry_completions.bash
15 changes: 4 additions & 11 deletions containers/ros/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ RUN apt-get update \
# Bootstrap Rosdep
RUN rosdep init

# Copy the ROS entry point
COPY entrypoint.d/ros_entrypoint.sh $ENTRYPOINT_DIR/20_ros_entrypoint.sh

# Switch to non-root user
USER $DEV_USER
WORKDIR $DEV_USER_HOME
Expand All @@ -75,12 +72,8 @@ RUN colcon --log-base /dev/null mixin add default "$COLCON_MIXIN_URL" \
&& colcon --log-base /dev/null metadata add default "$COLCON_METADATA_URL" \
&& colcon --log-base /dev/null metadata update

# Copy the extra bashrc for completion, etc
COPY bashrc_ros.bash $DEV_USER_HOME/.bashrc_ros
# Copy the ROS entry point
COPY entrypoint.d/ros_entrypoint.sh $ENTRYPOINT_DIR/20_ros_entrypoint.sh

# Enable ROS autocompletion
RUN { \
echo; \
echo "# Source extra ROS shell helpers"; \
echo "source \"\$HOME/.bashrc_ros\""; \
} >> $DEV_USER_HOME/.bashrc
# Copy the ROS setup for autocompletion, etc
COPY --chown=$DEV_USER bashrc.d/ros_setup.bash $DEV_USER_HOME/.bashrc.d/22_ros_setup.bash
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2026 Tim Perkins

# NOTE This script is expected to be sourced!

# Set up autocompletion, etc
source "/usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash"
source "/usr/share/colcon_cd/function/colcon_cd.sh"
Expand Down
Loading