Skip to content

Commit b948b44

Browse files
committed
fix: ensure openssh-server is installed and starts
`install_and_run_sshd` previously failed as the base Airflow images do not include the default ubuntu package repositories. As such, the openssh-server package could not be found. Additionally, the ssh_host_keys generated by sshd are owned by root. This causes permission related failures since the container runs as user airflow.
1 parent b3466dc commit b948b44

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

composer_local_dev/docker_files/entrypoint.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,13 @@ install_and_run_sshd() {
106106
echo "Installing sshd"
107107
if ! command -v /usr/sbin/sshd &> /dev/null
108108
then
109-
sudo apt-get -qq update && sudo DEBIAN_FRONTEND=noninteractive apt-get -qqy install openssh-server > /dev/null 2>&1
109+
sudo bash -c 'cat << EOF > /etc/apt/sources.list.d/default.list
110+
deb http://archive.ubuntu.com/ubuntu/ noble main restricted
111+
deb http://archive.ubuntu.com/ubuntu/ noble-updates main restricted
112+
EOF'
113+
sudo apt-get -qq update > /dev/null 2>&1
114+
sudo apt-get -qqy install openssh-server > /dev/null 2>&1
115+
sudo chown airflow:airflow /etc/ssh/ssh_host_*_key
110116
sudo mkdir /run/sshd
111117
echo "airflow:${COMPOSER_CONTAINER_AIRFLOW_USER_PASSWORD}" | sudo chpasswd
112118
fi

0 commit comments

Comments
 (0)