Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Install the socat binary into a CoreOS installation
# Insightful instructions, originally posted by Xynova (
# Make socat directories
mkdir -p /opt/bin/socat.d/bin /opt/bin/socat.d/lib
# Create socat wrapper
cat << EOF > /opt/bin/socat
#! /bin/bash
LD_LIBRARY_PATH=/opt/bin/socat.d/lib:$LD_LIBRARY_PATH exec /opt/bin/socat.d/bin/socat "\$@"
chmod +x /opt/bin/socat
# Get socat and libraries from the CoreOS toolbox
dnf install -y socat
cp -f /usr/bin/socat /media/root/opt/bin/socat.d/bin/socat
cp -f /usr/lib64/ /media/root/opt/bin/socat.d/lib/
cp -f /usr/lib64/ /media/root/opt/bin/socat.d/lib/
cp -f /usr/lib64/ /media/root/opt/bin/socat.d/lib/
# Then tell the kubelet to consider binaries in the /opt/bin directory .. maybe changing it to a socat specific isolated one is better
# /etc/systemd/system/kubelet.service
# [Unit]
# Description=Kubernetes Kubelet Master
# Documentation=
# [Service]
# ExecStartPre=/usr/bin/mkdir -p /etc/kubernetes/manifests
# ExecStartPre=/usr/bin/mkdir -p /etc/cni/net.d
# ExecStartPre=/usr/bin/mkdir -p /opt/cni/bin
# Environment="PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin"
# ...

This comment has been minimized.

Copy link

@xueshanf xueshanf commented Aug 9, 2017

@cdemers: I have a container install-socat to help with the installation. Thanks for the inspiration!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.