Skip to content

Commit

Permalink
containers/ws: Move COPR setup into install.sh
Browse files Browse the repository at this point in the history
There is little gain for doing this in Dockerfile, and wasting a entire
container layer for this. We don't even need it when installing local
RPMS, so move it to install.sh and only do it for the "install official
packages" case.
  • Loading branch information
martinpitt committed Jun 27, 2022
1 parent 0898d21 commit 0b06e80
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 0 additions & 4 deletions containers/ws/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@ ARG VERSION

ADD . /container

RUN echo -e '[group_cockpit-cockpit-preview]\nname=Copr repo for cockpit-preview owned by @cockpit\nbaseurl=https://copr-be.cloud.fedoraproject.org/results/@cockpit/cockpit-preview/fedora-$releasever-$basearch/\ntype=rpm-md\ngpgcheck=1\ngpgkey=https://copr-be.cloud.fedoraproject.org/results/@cockpit/cockpit-preview/pubkey.gpg\nrepo_gpgcheck=0\nenabled=1\nenabled_metadata=1' > /etc/yum.repos.d/cockpit.repo

RUN /container/install.sh

LABEL INSTALL="docker run --rm --privileged -v /:/host -e IMAGE=\${IMAGE} \${IMAGE} /container/label-install \${IMAGE}"
LABEL UNINSTALL="docker run --rm --privileged -v /:/host -e IMAGE=\${IMAGE} \${IMAGE} /container/label-uninstall"
LABEL RUN="docker run -d --name \${NAME} --privileged --pid=host -v /:/host -e NAME=\${NAME} -e IMAGE=\${IMAGE} \${IMAGE} /container/label-run"

# Look ma, no EXPOSE

CMD ["/container/label-run"]
2 changes: 2 additions & 0 deletions containers/ws/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ rpm=$(ls /container/rpms/cockpit-ws-*$OSVER.*$arch.rpm /container/rpms/cockpit-b
if [ -n "$rpm" ]; then
$INSTALLER -y install /container/rpms/cockpit-ws-*$OSVER.*$arch.rpm /container/rpms/cockpit-bridge-*$OSVER.*$arch.rpm
else
# pull packages from https://copr.fedorainfracloud.org/coprs/g/cockpit/cockpit-preview/
echo -e '[group_cockpit-cockpit-preview]\nname=Copr repo for cockpit-preview owned by @cockpit\nbaseurl=https://copr-be.cloud.fedoraproject.org/results/@cockpit/cockpit-preview/fedora-$releasever-$basearch/\ntype=rpm-md\ngpgcheck=1\ngpgkey=https://copr-be.cloud.fedoraproject.org/results/@cockpit/cockpit-preview/pubkey.gpg\nrepo_gpgcheck=0\nenabled=1\nenabled_metadata=1' > /etc/yum.repos.d/cockpit.repo
ws=$(package_name "cockpit-ws")
bridge=$(package_name "cockpit-bridge")
"$INSTALLER" -y install "$ws" "$bridge"
Expand Down

0 comments on commit 0b06e80

Please sign in to comment.