Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add repo tool to images #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ cd -

# base tests
./tests/container/vnc-test.sh $REPO:$DISTRO_TO_BUILD-base
./tests/container/repo-test.sh $REPO:$DISTRO_TO_BUILD-base
# builder tests
./tests/container/smoke.sh $REPO:$DISTRO_TO_BUILD-builder

Expand Down
3 changes: 3 additions & 0 deletions dockerfiles/centos/centos-7/centos-7-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ RUN yum -y install epel-release && \
mkdir /etc/vncskel/.vnc && \
echo "" | vncpasswd -f > /etc/vncskel/.vnc/passwd && \
chmod 0600 /etc/vncskel/.vnc/passwd && \
# Repo is a useful tool for checking out multiple git repos
wget https://storage.googleapis.com/git-repo-downloads/repo -O /usr/local/bin/repo && \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this isn't coming from the package manager and thus doesn't do verification automatically, it should at least do a checksum comparison against an expected version.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rewitt1 @moto-timo: repo is a tool I want to be able to use in crops containers so taking a look at this. The issue is that the URL https://storage.googleapis.com/git-repo-downloads/repo gets you the latest release of repo and so we can't expect it to match any given checksum for long. repo really doesn't support running anything other than the very latest commit, it actually pulls the latest commit from its own git repository when you run it. Sadly it's a widely used tool and we do need to try to support it.

The https cert for storage.goolgeapis.com will be checked as part of this download so that should be safe.

Copy link
Member Author

@moto-timo moto-timo May 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The source of most of this PR was from #22 including the Intel copyright (I don't think I did much modification of any of his work). I think #22 was just copy paste of existing scripts. We are currently installing repotool into the running container, so I have more or less stopped working on this. It is a frequent enough request to warrant further work. It would be great if you can pick this up @pbrkr

chmod +x /usr/local/bin/repo && \
groupadd -g 1000 yoctouser && \
useradd -u 1000 -g yoctouser -m yoctouser

Expand Down
3 changes: 3 additions & 0 deletions dockerfiles/debian/debian-10/debian-10-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ RUN apt-get clean && \
mkdir /etc/vncskel/.vnc && \
echo "" | vncpasswd -f > /etc/vncskel/.vnc/passwd && \
chmod 0600 /etc/vncskel/.vnc/passwd && \
# Repo is a useful tool for checking out multiple git repos
wget https://storage.googleapis.com/git-repo-downloads/repo -O /usr/local/bin/repo && \
chmod +x /usr/local/bin/repo && \
useradd -U -m yoctouser && \
echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && locale-gen

Expand Down
3 changes: 3 additions & 0 deletions dockerfiles/debian/debian-9/debian-9-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ RUN apt-get clean && \
mkdir /etc/vncskel/.vnc && \
echo "" | vncpasswd -f > /etc/vncskel/.vnc/passwd && \
chmod 0600 /etc/vncskel/.vnc/passwd && \
# Repo is a useful tool for checking out multiple git repos
wget https://storage.googleapis.com/git-repo-downloads/repo -O /usr/local/bin/repo && \
chmod +x /usr/local/bin/repo && \
useradd -U -m yoctouser && \
echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && locale-gen

Expand Down
3 changes: 3 additions & 0 deletions dockerfiles/fedora/fedora-28/fedora-28-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ RUN dnf -y update && \
mkdir /etc/vncskel/.vnc && \
echo "" | vncpasswd -f > /etc/vncskel/.vnc/passwd && \
chmod 0600 /etc/vncskel/.vnc/passwd && \
# Repo is a useful tool for checking out multiple git repos
wget https://storage.googleapis.com/git-repo-downloads/repo -O /usr/local/bin/repo && \
chmod +x /usr/local/bin/repo && \
useradd -U -m yoctouser

COPY build-install-dumb-init.sh /
Expand Down
3 changes: 3 additions & 0 deletions dockerfiles/fedora/fedora-29/fedora-29-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ RUN dnf -y update && \
mkdir /etc/vncskel/.vnc && \
echo "" | vncpasswd -f > /etc/vncskel/.vnc/passwd && \
chmod 0600 /etc/vncskel/.vnc/passwd && \
# Repo is a useful tool for checking out multiple git repos
wget https://storage.googleapis.com/git-repo-downloads/repo -O /usr/local/bin/repo && \
chmod +x /usr/local/bin/repo && \
useradd -U -m yoctouser

COPY build-install-dumb-init.sh /
Expand Down
3 changes: 3 additions & 0 deletions dockerfiles/fedora/fedora-30/fedora-30-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ RUN dnf -y update && \
mkdir /etc/vncskel/.vnc && \
echo "" | vncpasswd -f > /etc/vncskel/.vnc/passwd && \
chmod 0600 /etc/vncskel/.vnc/passwd && \
# Repo is a useful tool for checking out multiple git repos
wget https://storage.googleapis.com/git-repo-downloads/repo -O /usr/local/bin/repo && \
chmod +x /usr/local/bin/repo && \
useradd -U -m yoctouser

COPY build-install-dumb-init.sh /
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ RUN zypper --non-interactive install python \
mkdir /etc/vncskel/.vnc && \
echo "" | vncpasswd -f > /etc/vncskel/.vnc/passwd && \
chmod 0600 /etc/vncskel/.vnc/passwd && \
# Repo is a useful tool for checking out multiple git repos
wget https://storage.googleapis.com/git-repo-downloads/repo -O /usr/local/bin/repo && \
chmod +x /usr/local/bin/repo && \
useradd -U -m yoctouser

COPY build-install-dumb-init.sh /
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ RUN zypper --non-interactive install python \
mkdir /etc/vncskel/.vnc && \
echo "" | vncpasswd -f > /etc/vncskel/.vnc/passwd && \
chmod 0600 /etc/vncskel/.vnc/passwd && \
# Repo is a useful tool for checking out multiple git repos
wget https://storage.googleapis.com/git-repo-downloads/repo -O /usr/local/bin/repo && \
chmod +x /usr/local/bin/repo && \
useradd -U -m yoctouser

COPY build-install-dumb-init.sh /
Expand Down
3 changes: 3 additions & 0 deletions dockerfiles/ubuntu/ubuntu-16.04/ubuntu-16.04-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ RUN apt-get update && \
mkdir /etc/vncskel/.vnc && \
echo "" | vncpasswd -f > /etc/vncskel/.vnc/passwd && \
chmod 0600 /etc/vncskel/.vnc/passwd && \
# Repo is a useful tool for checking out multiple git repos
wget https://storage.googleapis.com/git-repo-downloads/repo -O /usr/local/bin/repo && \
chmod +x /usr/local/bin/repo && \
useradd -U -m yoctouser && \
/usr/sbin/locale-gen en_US.UTF-8

Expand Down
3 changes: 3 additions & 0 deletions dockerfiles/ubuntu/ubuntu-18.04/ubuntu-18.04-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ RUN apt-get update && \
mkdir /etc/vncskel/.vnc && \
echo "" | vncpasswd -f > /etc/vncskel/.vnc/passwd && \
chmod 0600 /etc/vncskel/.vnc/passwd && \
# Repo is a useful tool for checking out multiple git repos
wget https://storage.googleapis.com/git-repo-downloads/repo -O /usr/local/bin/repo && \
chmod +x /usr/local/bin/repo && \
useradd -U -m yoctouser && \
/usr/sbin/locale-gen en_US.UTF-8

Expand Down
3 changes: 3 additions & 0 deletions dockerfiles/ubuntu/ubuntu-19.04/ubuntu-19.04-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ RUN apt-get update && \
mkdir /etc/vncskel/.vnc && \
echo "" | vncpasswd -f > /etc/vncskel/.vnc/passwd && \
chmod 0600 /etc/vncskel/.vnc/passwd && \
# Repo is a useful tool for checking out multiple git repos
wget https://storage.googleapis.com/git-repo-downloads/repo -O /usr/local/bin/repo && \
chmod +x /usr/local/bin/repo && \
useradd -U -m yoctouser && \
/usr/sbin/locale-gen en_US.UTF-8

Expand Down
31 changes: 31 additions & 0 deletions tests/container/repo-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

# repo-test
#
# Copyright (C) 2016 Intel Corporation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Year should probably be updated.

#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

set -e
set -x


# Pass in the image that was built for docker
image=$1
workdir=`mktemp -d --suffix=vnc`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"vnc" looks like a copy-paste leftover.

SCRIPT_DIR=$(dirname $(readlink -f $0))

docker run -t --rm -v $workdir:/workdir \
$image repo help init
rm $workdir -rf