mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-28 08:17:37 +00:00
obs: Remove golang from osc dockerfile
Reduce pipeline time by not installing golang. golang is not needed to use osc, it makes slower the image creation. - remove go dependency from pacakge lib Remove calls to golang, this will be not not installed in the docker image. Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
This commit is contained in:
parent
01238997d0
commit
c7225fe0c8
@ -1,8 +1,6 @@
|
||||
FROM opensuse:leap
|
||||
|
||||
ARG GO_VERSION=${GO_VERSION:-1.10.2}
|
||||
ARG SUSE_VERSION=${SUSE_VERSION:-42.3}
|
||||
ARG GO_ARCH=${GO_ARCH:-amd64}
|
||||
|
||||
# Get OBS client, plugins and dependencies
|
||||
RUN zypper -v -n install osc-plugin-install vim curl bsdtar git sudo
|
||||
@ -15,14 +13,3 @@ RUN zypper -v -n install build \
|
||||
obs-service-obs_scm \
|
||||
obs-service-recompress \
|
||||
obs-service-download_url
|
||||
|
||||
# Set Go environment
|
||||
RUN curl -OL https://dl.google.com/go/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz
|
||||
RUN tar -C /usr/local -xzf go${GO_VERSION}.linux-${GO_ARCH}.tar.gz
|
||||
|
||||
# Local build dependencies
|
||||
RUN zypper -v -n install make gcc yum xz pcre-tools
|
||||
|
||||
# Add go compiler to the PATH
|
||||
ENV PATH /usr/local/go/bin:$PATH
|
||||
ENV GOPATH /root/go
|
||||
|
@ -14,10 +14,11 @@ readonly script_name="$(basename "${BASH_SOURCE[0]}")"
|
||||
readonly script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
readonly versions_txt="versions.txt"
|
||||
project="kata-containers"
|
||||
ARCH=${ARCH:-$(go env GOARCH)}
|
||||
|
||||
source "${script_dir}/../scripts/lib.sh"
|
||||
|
||||
ARCH=${ARCH:-$(arch_to_golang "$(uname -m)")}
|
||||
|
||||
get_kata_version() {
|
||||
local branch="$1"
|
||||
curl -SsL "https://raw.githubusercontent.com/${project}/runtime/${branch}/VERSION"
|
||||
|
@ -3,7 +3,10 @@
|
||||
# This is a helper library for the setup scripts of each package
|
||||
# in this repository.
|
||||
|
||||
source ../versions.txt
|
||||
source_dir_pkg_lib=$(dirname "${BASH_SOURCE[ ${#BASH_SOURCE[@]} - 1 ]}")
|
||||
source "${source_dir_pkg_lib}/../../scripts/lib.sh"
|
||||
source "${source_dir_pkg_lib}/../versions.txt"
|
||||
|
||||
PACKAGING_DIR=/var/packaging
|
||||
LOG_DIR=${PACKAGING_DIR}/build_logs
|
||||
|
||||
@ -21,19 +24,28 @@ LOCAL_BUILD=false
|
||||
OBS_PUSH=false
|
||||
VERBOSE=false
|
||||
|
||||
arch_to_golang()
|
||||
{
|
||||
local -r arch="$1"
|
||||
|
||||
case "$arch" in
|
||||
aarch64) echo "arm64";;
|
||||
ppc64le) echo "$arch";;
|
||||
x86_64) echo "amd64";;
|
||||
s390x) echo "s390x";;
|
||||
*) die "unsupported architecture: $arch";;
|
||||
esac
|
||||
}
|
||||
# Used for debian.control files
|
||||
# Architecture: The architecture specifies which type of hardware this
|
||||
# package was compiled for.
|
||||
DEB_ARCH="$(go env GOARCH)"
|
||||
|
||||
short_commit_length=10
|
||||
|
||||
if command -v go; then
|
||||
export GO_ARCH=$(go env GOARCH)
|
||||
else
|
||||
export GO_ARCH=amd64
|
||||
echo "Go not installed using $GO_ARCH to install go in dockerfile"
|
||||
fi
|
||||
arch=$(uname -m)
|
||||
DEB_ARCH=$(arch_to_golang "$arch")
|
||||
GO_ARCH=$(arch_to_golang "$arch")
|
||||
export GO_ARCH
|
||||
|
||||
function display_help() {
|
||||
cat <<-EOL
|
||||
|
@ -95,3 +95,16 @@ get_kata_hash_from_tag() {
|
||||
repo=$1
|
||||
git ls-remote --tags "https://github.com/${project}/${repo}.git" | grep "refs/tags/${kata_version}^{}" | awk '{print $1}'
|
||||
}
|
||||
|
||||
arch_to_golang()
|
||||
{
|
||||
local -r arch="$1"
|
||||
|
||||
case "$arch" in
|
||||
aarch64) echo "arm64";;
|
||||
ppc64le) echo "$arch";;
|
||||
x86_64) echo "amd64";;
|
||||
s390x) echo "s390x";;
|
||||
*) die "unsupported architecture: $arch";;
|
||||
esac
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user