Skip to content

Instantly share code, notes, and snippets.

@vmanyushin
Created August 21, 2025 14:34
Show Gist options
  • Save vmanyushin/9761270b8544bb63e6b9bf591f1b80cf to your computer and use it in GitHub Desktop.
Save vmanyushin/9761270b8544bb63e6b9bf591f1b80cf to your computer and use it in GitHub Desktop.
Build vector (https://vector.dev) for CentOS7 using podman
Dockerfile
===========================================
FROM docker.io/centos:centos7.9.2009
RUN rm -rf /etc/yum.repos.d/CentOS* \
&& cat > /etc/yum.repos.d/CentOS-Base.repo <<"EOF"
[base]
name=CentOS-7.9.2009 - Base
baseurl=http://vault.centos.org/7.9.2009/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
metadata_expire=never
[updates]
name=CentOS-7.9.2009 - Updates
baseurl=http://vault.centos.org/7.9.2009/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
metadata_expire=never
[extras]
name=CentOS-7.9.2009 - Extras
baseurl=http://vault.centos.org/7.9.2009/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
metadata_expire=never
[centosplus]
name=CentOS-7.9.2009 - CentOSPlus
baseurl=http://vault.centos.org/7.9.2009/centosplus/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
metadata_expire=never
[fasttrack]
name=CentOS-7.9.2009 - Contrib
baseurl=http://vault.centos.org/7.9.2009/fasttrack/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
metadata_expire=never
EOF
RUN yum groupinstall -y "Development tools" \
&& yum install -y perl-IPC-Cmd openssl-devel cyrus-sasl \
&& ln -s /usr/lib64/libsasl2.so.3 /usr/lib64/libsasl2.so \
&& cd /usr/local \
&& curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v32.0/protoc-32.0-linux-x86_64.zip \
&& unzip protoc-32.0-linux-x86_64.zip \
&& rm protoc-32.0-linux-x86_64.zip \
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
RUN source "$HOME/.cargo/env" \
&& cd /build \
&& mkdir -p vector \
&& curl -sSfL --proto '=https' --tlsv1.2 https://api.github.com/repos/vectordotdev/vector/tarball/v0.49.0 | tar xzf - -C vector --strip-components=1 \
&& cd vector \
&& make build
===========================================
mkdir build
podman build -v $(pwd)/build:/build -f Dockerfile .
cp build/vector/target/release/vector .
rm -rf build/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment