Sha256: 0484f876d3f06f3e576726bdf55c06fa38a12a7efcbde5663327ab83c2de9c69

Contents?: true

Size: 918 Bytes

Versions: 23

Compression:

Stored size: 918 Bytes

Contents

# typed: strict

module Kuby
  module Docker
    module Packages
      class Nodejs < Package
        extend T::Sig

        sig { params(dockerfile: Dockerfile).void }
        def install_on_debian(dockerfile)
          install_from_image("node:#{version}", dockerfile)
        end

        sig { params(dockerfile: Dockerfile).void }
        def install_on_alpine(dockerfile)
          install_from_image("node:#{version}-alpine", dockerfile)
        end

        sig { returns(String) }
        def version
          @version || 'current'
        end

        private

        sig { params(image: String, dockerfile: Dockerfile).void }
        def install_from_image(image, dockerfile)
          dockerfile.insert_at(0) do
            dockerfile.from(image, as: 'nodejs')
          end

          dockerfile.copy('/usr/local/bin/node', '/usr/local/bin/node', from: 'nodejs')
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
kuby-core-0.17.0 lib/kuby/docker/packages/nodejs.rb
kuby-core-0.16.1 lib/kuby/docker/packages/nodejs.rb
kuby-core-0.16.0 lib/kuby/docker/packages/nodejs.rb
kuby-core-0.15.0 lib/kuby/docker/packages/nodejs.rb
kuby-core-0.14.0 lib/kuby/docker/packages/nodejs.rb
kuby-core-0.13.0 lib/kuby/docker/packages/nodejs.rb
kuby-core-0.12.0 lib/kuby/docker/packages/nodejs.rb
kuby-core-0.11.16 lib/kuby/docker/packages/nodejs.rb
kuby-core-0.11.15 lib/kuby/docker/packages/nodejs.rb
kuby-core-0.11.14 lib/kuby/docker/packages/nodejs.rb
kuby-core-0.11.13 lib/kuby/docker/packages/nodejs.rb
kuby-core-0.11.12 lib/kuby/docker/packages/nodejs.rb
kuby-core-0.11.11 lib/kuby/docker/packages/nodejs.rb
kuby-core-0.11.10 lib/kuby/docker/packages/nodejs.rb
kuby-core-0.11.9 lib/kuby/docker/packages/nodejs.rb
kuby-core-0.11.8 lib/kuby/docker/packages/nodejs.rb
kuby-core-0.11.7 lib/kuby/docker/packages/nodejs.rb
kuby-core-0.11.6 lib/kuby/docker/packages/nodejs.rb
kuby-core-0.11.4 lib/kuby/docker/packages/nodejs.rb
kuby-core-0.11.3 lib/kuby/docker/packages/nodejs.rb