Skip to content

Instantly share code, notes, and snippets.

@radekg
Last active May 6, 2022 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save radekg/3f749cba86e91a8c88eb0e88c8b8754c to your computer and use it in GitHub Desktop.
Save radekg/3f749cba86e91a8c88eb0e88c8b8754c to your computer and use it in GitHub Desktop.
FROM centos:7.9.2009 as builder
ARG YB_VERSION=2.7.1.1
RUN yum update -y && yum install -y wget curl \
&& wget https://downloads.yugabyte.com/yugabyte-${YB_VERSION}-linux.tar.gz -O /yugabyte-${YB_VERSION}-linux.tar.gz
FROM centos:7.9.2009
ARG GID=1060
ARG GROUPNAME=myybuser
ARG UID=1060
ARG USERNAME=myybuser
ARG YB_VERSION=2.7.1.1
RUN groupadd -g ${GID} ${GROUPNAME} \
&& useradd -m -d /home/${USERNAME} -g ${GID} -u ${UID} -s /bin/bash ${USERNAME}
COPY --from=builder /yugabyte-${YB_VERSION}-linux.tar.gz /home/${USERNAME}/yugabyte-${YB_VERSION}-linux.tar.gz
RUN tar xvfz /home/${USERNAME}/yugabyte-${YB_VERSION}-linux.tar.gz -C /home/${USERNAME} --strip 1 \
&& /home/${USERNAME}/bin/post_install.sh \
&& chown -R ${USERNAME}:${GROUPNAME} /home/${USERNAME} \
&& ln -s /home/${USERNAME}/bin/yb-admin /usr/local/bin/yb-admin \
&& ln -s /home/${USERNAME}/bin/yb-ts-cli /usr/local/bin/yb-ts-cli \
&& ln -s /home/${USERNAME}/bin/ycqlsh /usr/local/bin/ycqlsh \
&& ln -s /home/${USERNAME}/bin/ysqlsh /usr/local/bin/ysqlsh \
&& ln -s /home/${USERNAME}/bin/yugabyted /usr/local/bin/yugabyted \
&& chown -R ${USERNAME}:${GROUPNAME} /usr/local/bin
USER ${USERNAME}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment