diff options
Diffstat (limited to 'src/ruby')
-rw-r--r-- | src/ruby/devcontainer-feature.json | 4 | ||||
-rwxr-xr-x | src/ruby/install.sh | 15 |
2 files changed, 13 insertions, 6 deletions
diff --git a/src/ruby/devcontainer-feature.json b/src/ruby/devcontainer-feature.json index 9e617d0..e2d909f 100644 --- a/src/ruby/devcontainer-feature.json +++ b/src/ruby/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "ruby", - "version": "1.0.4", + "version": "1.0.5", "name": "Ruby (via rvm)", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/ruby", "description": "Installs Ruby, rvm, rbenv, common Ruby utilities, and needed dependencies.", @@ -31,4 +31,4 @@ "MY_RUBY_HOME": "/usr/local/rvm/rubies/default", "PATH": "/usr/local/rvm/gems/default/bin:/usr/local/rvm/gems/default@global/bin:/usr/local/rvm/rubies/default/bin:/usr/local/share/rbenv/bin:${PATH}" } -}
\ No newline at end of file +} diff --git a/src/ruby/install.sh b/src/ruby/install.sh index 6ff3b2f..2228522 100755 --- a/src/ruby/install.sh +++ b/src/ruby/install.sh @@ -28,6 +28,9 @@ keyserver hkp://keyserver.pgp.com" set -e +# Clean up +rm -rf /var/lib/apt/lists/* + if [ "$(id -u)" -ne 0 ]; then echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.' exit 1 @@ -154,8 +157,10 @@ find_version_from_git_tags() { apt_get_update() { - echo "Running apt-get update..." - apt-get update -y + if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then + echo "Running apt-get update..." + apt-get update -y + fi } # Checks if packages are installed and installs them if not @@ -180,8 +185,7 @@ check_packages curl ca-certificates software-properties-common build-essential g procps dirmngr gawk autoconf automake bison libffi-dev libgdbm-dev libncurses5-dev \ libsqlite3-dev libtool libyaml-dev pkg-config sqlite3 zlib1g-dev libgmp-dev libssl-dev if ! type git > /dev/null 2>&1; then - apt_get_update - apt-get -y install --no-install-recommends git + check_packages git fi @@ -301,4 +305,7 @@ find "/usr/local/rvm/" -type d | xargs -n 1 chmod g+s rvm cleanup all ${ROOT_GEM} cleanup +# Clean up +rm -rf /var/lib/apt/lists/* + echo "Done!" |