Skip to content

Commit

Permalink
Install oc and virtctl binaries under /root/bin
Browse files Browse the repository at this point in the history
  • Loading branch information
atodorov committed Mar 13, 2024
1 parent e3c6114 commit c04fe15
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/images/cloud-tools.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ ARG OSB_DNF_GROUPS=""
COPY src/config/*.repo /etc/yum.repos.d/
RUN ./src/scripts/dnf.sh "${OSB_DNF_PACKAGES}" "${OSB_DNF_GROUPS}"
RUN ./src/scripts/install-oci-cli.sh
RUN ./src/scripts/install-openshift-cli.sh

RUN rm -rf /cloud-tools/src

Expand Down
22 changes: 22 additions & 0 deletions src/scripts/install-openshift-cli.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

set -eox pipefail

TEMPDIR=$(mktemp -d)

# WARNING: these will only work on x86_64

# https://docs.openshift.com/container-platform/4.13/cli_reference/openshift_cli/getting-started-cli.html
curl -L --insecure https://downloads-openshift-console.apps.ocp-virt.prod.psi.redhat.com/amd64/linux/oc.tar --output-dir "$TEMPDIR"
# https://docs.openshift.com/container-platform/4.13/virt/virt-using-the-cli-tools.html
curl -L --insecure https://hyperconverged-cluster-cli-download-openshift-cnv.apps.ocp-virt.prod.psi.redhat.com/amd64/linux/virtctl.tar.gz --output-dir "$TEMPDIR"

pushd "$TEMPDIR"
tar -xvf oc.tar
tar -xzvf virtctl.tar.gz
popd

cp "$TEMPDIR/oc" /root/bin
cp "$TEMPDIR/virtctl" /root/bin

chmod a+x /root/bin/*

0 comments on commit c04fe15

Please sign in to comment.