-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement build for Skopeo devel/CI container image
This is significantly different from the podman images (used by buildah and podman CI). Namely, it includes several different registry executables needed during Skopeo's integration and system-tests. Pre-building these into a container saves developer time locally and in waiting for changes to pass CI testing. Also, modernize the registry server login to use the `--password-stdin` scheme instead of encrypting the entire command-line. Signed-off-by: Chris Evich <cevich@redhat.com>
- Loading branch information
Showing
7 changed files
with
198 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
ARG BASE_NAME=fedora | ||
ARG BASE_TAG=latest | ||
FROM ${BASE_NAME}:${BASE_TAG} | ||
|
||
COPY /packages.txt /root/ | ||
RUN dnf -y update && \ | ||
dnf -y install $(sed -r -e '/^#/d' -e '/^$/d' /root/packages.txt) && \ | ||
dnf -y upgrade && \ | ||
dnf clean all | ||
|
||
ENV REG_REPO="https://github.com/docker/distribution.git" \ | ||
REG_COMMIT="47a064d4195a9b56133891bbb13620c3ac83a827" \ | ||
REG_COMMIT_SCHEMA1="ec87e9b6971d831f0eff752ddb54fb64693e51cd" \ | ||
OSO_REPO="https://github.com/openshift/origin.git" \ | ||
OSO_TAG="v1.5.0-alpha.3" | ||
|
||
COPY /setup.sh /root/ | ||
RUN bash /root/setup.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Skopeo CI/Dev image | ||
|
||
The contents of this directory are intended to be utilized via | ||
the `Makefile` at the top of the repository. Typically as | ||
`make skopeo_cidev IMG_SFX=<id>`. The resultant image is utilized | ||
as part of the [skopeo project's](https://github.com/containers/skopeo) | ||
development and CI automation. It should not be used outside | ||
of those contexts. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# general deps | ||
git | ||
golang | ||
golang-github-cpuguy83-md2man | ||
make | ||
|
||
# Skopeo documentation building | ||
btrfs-progs-devel | ||
device-mapper-devel | ||
golang | ||
gpgme-devel | ||
make | ||
|
||
# storage deps | ||
btrfs-progs-devel | ||
device-mapper-devel | ||
|
||
# gpgme bindings deps | ||
libassuan-devel | ||
gnupg | ||
gpgme-devel | ||
|
||
# htpasswd for system tests | ||
httpd-tools | ||
|
||
# OpenShift deps | ||
bats | ||
bsdtar | ||
device-mapper | ||
docker | ||
e2fsprogs | ||
ethtool | ||
findutils | ||
golint | ||
hostname | ||
iproute | ||
iptables | ||
jq | ||
lsof | ||
nmap-ncat | ||
openssl | ||
podman | ||
runc | ||
socat | ||
tar | ||
tree | ||
util-linux | ||
wget | ||
which | ||
xfsprogs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
|
||
|
||
# This script is used by the Containerfile when building an image. | ||
# It should NEVER ever (EVER!) be used under any other circumstances | ||
# (nor set as executable). | ||
|
||
set -e | ||
|
||
declare -a req_vars | ||
req_vars=(\ | ||
REG_REPO | ||
REG_COMMIT | ||
REG_COMMIT_SCHEMA1 | ||
OSO_REPO | ||
OSO_TAG | ||
) | ||
for req_var in "${req_vars[@]}"; do | ||
if [[ -z "${!req_var}" ]]; then | ||
echo "ERROR: Required variable \$$req_var is unset or empty." | ||
exit 1 | ||
fi | ||
done | ||
|
||
GOPATH=$(mktemp -d -p '' ".tmp_$(basename ${BASH_SOURCE[0]})_XXXXXXXX") | ||
REG_GOSRC="$GOPATH/src/github.com/docker/distribution" \ | ||
OSO_GOSRC="$GOPATH/src/github.com/openshift/origin" | ||
|
||
# All golang code built here pre-dates support of go modules | ||
export GO111MODULE=off | ||
|
||
# Workaround unnecessary swap-enabling shenanagains in openshift-origin build | ||
export OS_BUILD_SWAP_DISABLE=1 | ||
|
||
# Make debugging easier | ||
set -x | ||
|
||
# This comes in from the Containerfile | ||
# shellcheck disable=SC2154 | ||
git clone "$REG_REPO" "$REG_GOSRC" | ||
cd "$REG_GOSRC" | ||
|
||
# Don't pollute the environment | ||
( | ||
# This is required to be set like this by the build system | ||
export GOPATH="$PWD/Godeps/_workspace:$GOPATH" | ||
# This comes in from the Containerfile | ||
# shellcheck disable=SC2154 | ||
git checkout -q "$REG_COMMIT" | ||
go build -o /usr/local/bin/registry-v2 \ | ||
github.com/docker/distribution/cmd/registry | ||
|
||
# This comes in from the Containerfile | ||
# shellcheck disable=SC2154 | ||
git checkout -q "$REG_COMMIT_SCHEMA1" | ||
go build -o /usr/local/bin/registry-v2-schema1 \ | ||
github.com/docker/distribution/cmd/registry | ||
) | ||
|
||
# These come in from the Containerfile | ||
# shellcheck disable=SC2154 | ||
git clone --depth 1 -b "$OSO_TAG" "$OSO_REPO" "$OSO_GOSRC" | ||
cd "$OSO_GOSRC" | ||
|
||
# Edit out a "go < 1.5" check which works incorrectly with go ≥ 1.10. | ||
sed -i -e 's/\[\[ "\${go_version\[2]}" < "go1.5" ]]/false/' ./hack/common.sh | ||
|
||
make build | ||
make all WHAT=cmd/dockerregistry | ||
cp -a ./_output/local/bin/linux/*/* /usr/local/bin/ | ||
cp ./images/dockerregistry/config.yml /atomic-registry-config.yml | ||
mkdir /registry | ||
|
||
# When script unsuccessful, leave this behind for debugging | ||
rm -rf $GOPATH |