From 6368d490fdb2d8931510c9c8a2be990ff4e8a5e9 Mon Sep 17 00:00:00 2001 From: Maicon Filippsen Date: Mon, 22 Mar 2021 08:46:32 -0300 Subject: [PATCH] Simplify Docker image specification by removing no longer used dependencies * Update Docker image base to more recent Alpine version * Update test build script to reflect latest changes - Remove remaining references to Lua, Lua rocks and Lua libraries - Remove check lua binaries and libraries verification scripts --- build/Dockerfile | 26 +--------- test/build/check_lua_binaries.sh | 84 ------------------------------- test/build/check_lua_libraries.sh | 38 -------------- test/test_build.sh | 17 ------- 4 files changed, 2 insertions(+), 163 deletions(-) delete mode 100755 test/build/check_lua_binaries.sh delete mode 100755 test/build/check_lua_libraries.sh diff --git a/build/Dockerfile b/build/Dockerfile index d74eb04..77bbf1c 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,5 +1,5 @@ # -FROM alpine:3.6 +FROM alpine:3.13 MAINTAINER https://github.com/space-sh/space/ # Version @@ -10,31 +10,9 @@ ENV VERSION $VERSION # Space files COPY Spacefile.sh Spacefile.yaml space ./ -# Lua rocks and lua libs build dependencies -RUN apk add --no-cache --virtual .build-deps autoconf gcc libc-dev lua5.1-dev make openssl unzip \ - # Base install - && apk add --no-cache bash curl git lua5.1 luajit yaml-dev \ - -# Lua rocks - && curl -LO https://luarocks.org/releases/luarocks-2.4.1.tar.gz \ - && tar zxpf luarocks-2.4.1.tar.gz \ - && cd luarocks-2.4.1 \ - && ./configure \ - && make bootstrap \ - && cd .. \ - && rm -rf ./luarocks-2.4.1 luarocks-2.4.1.tar.gz \ - -# Lua libs - && luarocks install lbase64 \ - && luarocks install lua-cjson \ - && luarocks install luaposix \ - && luarocks install lyaml \ - -# Cleanup - && apk del .build-deps \ +RUN apk add --no-cache bash curl git \ # Space && ./space /install/ \ && rm Spacefile.sh Spacefile.yaml space - diff --git a/test/build/check_lua_binaries.sh b/test/build/check_lua_binaries.sh deleted file mode 100755 index e3ca075..0000000 --- a/test/build/check_lua_binaries.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env sh -# -# Copyright 2016-2017 Blockie AB -# -# This file is part of Space. -# -# Space is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation version 3 of the License. -# -# Space 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 Space. If not, see . -# - -# -# Check for Lua binaries -# -set -o nounset - - -#========================= -# _check_version -# -# Checks current major.minor version is equal or bigger than -# required major.minor -# -# Parameters: -# 1: program name for message output -# 2: required major version number -# 3: required minor version number -# 4: current major version number -# 5: current minor version number -# -#========================= -_check_version() -{ - local _program_name=$1 - local _required_major=$2 - local _required_minor=$3 - local _current_major=$4 - local _current_minor=$5 - if [ "$_current_major" -lt "$_required_major" ] \ - || ( [ "$_current_major" -le "$_required_major" ] && [ "$_current_minor" -lt "$_required_minor" ]); then - printf "FAIL: %s version is too old. Version %s.%s or later is required. Current version: %s.%s\n" \ - "$_program_name" "$_required_major" "$_required_minor" "$_current_major" "$_current_minor" 1>&2 - exit 1 - fi -} - -# -# lua -if ! command -v lua5.1 >/dev/null; then - printf "Missing lua5.1 program\n" 1>&2 - exit 1 -else - _LUA_REQUIRED_MAJOR="5" - _LUA_REQUIRED_MINOR="1" - _LUA_VERSION="$(lua5.1 -v 2>&1 | cut -d ' ' -f2)" - _LUA_CURRENT_MAJOR="$(printf $_LUA_VERSION | cut -d. -f1)" - _LUA_CURRENT_MINOR="$(printf $_LUA_VERSION | cut -d. -f2)" - _check_version "lua" "$_LUA_REQUIRED_MAJOR" "$_LUA_REQUIRED_MINOR" "$_LUA_CURRENT_MAJOR" "$_LUA_CURRENT_MINOR" - printf "OK: lua %s.%s\n" "$_LUA_CURRENT_MAJOR" "$_LUA_CURRENT_MINOR" -fi - -# -# luajit -if ! command -v luajit >/dev/null; then - printf "Missing luajit program\n" 1>&2 - exit 1 -else - _LUAJIT_REQUIRED_MAJOR="2" - _LUAJIT_REQUIRED_MINOR="0" - _LUAJIT_VERSION="$(luajit -v | cut -d ' ' -f2)" - _LUAJIT_CURRENT_MAJOR="$(printf $_LUAJIT_VERSION | cut -d. -f1)" - _LUAJIT_CURRENT_MINOR="$(printf $_LUAJIT_VERSION | cut -d. -f2)" - _check_version "luajit" "$_LUAJIT_REQUIRED_MAJOR" "$_LUAJIT_REQUIRED_MINOR" "$_LUAJIT_CURRENT_MAJOR" "$_LUAJIT_CURRENT_MINOR" - printf "OK: luajit %s.%s\n" "$_LUAJIT_CURRENT_MAJOR" "$_LUAJIT_CURRENT_MINOR" -fi - diff --git a/test/build/check_lua_libraries.sh b/test/build/check_lua_libraries.sh deleted file mode 100755 index 8316ba9..0000000 --- a/test/build/check_lua_libraries.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env sh -# -# Copyright 2016-2017 Blockie AB -# -# This file is part of Space. -# -# Space is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation version 3 of the License. -# -# Space 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 Space. If not, see . -# - -# -# Check for Lua libraries -# -set -o nounset - -if command -v "lua5.1" >/dev/null 2>&1 ; then - for _lib_name in "lyaml" "base64" "cjson" "posix"; do - if ! "lua5.1" -e "require '${_lib_name}'" 2>/dev/null ; then - printf "FAIL: could not find library %s\n" "$_lib_name" 1>&2 - exit 1 - else - printf "OK: %s\n" "$_lib_name" - fi - done -else - printf "FAIL: missing lua5.1 program\n" 1>&2 - exit 1 -fi - diff --git a/test/test_build.sh b/test/test_build.sh index 0274c8b..e727993 100755 --- a/test/test_build.sh +++ b/test/test_build.sh @@ -53,20 +53,3 @@ else printf "\033[31m[ERROR] Base libraries\033[0m\n" exit 1 fi - -cat ./test/build/check_lua_binaries.sh | docker run --rm -i $CI_REGISTRY_IMAGE:$IMAGE_VERSION /bin/bash -if [ "$?" -eq 0 ]; then - printf "\033[32m[OK] Lua binaries\033[0m\n" -else - printf "\033[31m[ERROR] Lua binaries\033[0m\n" - exit 1 -fi - -cat ./test/build/check_lua_libraries.sh | docker run --rm -i $CI_REGISTRY_IMAGE:$IMAGE_VERSION /bin/bash -if [ "$?" -eq 0 ]; then - printf "\033[32m[OK] Lua libraries\033[0m\n" -else - printf "\033[31m[ERROR] Lua libraries\033[0m\n" - exit 1 -fi -