Show HN: Squeaker: Like Docker, but for Smalltalk Images

Like Docker, but for Smalltalk images. You know, for kids. It’s a small program that helps in automated derivation of configured Smalltalk images from some fixed base image and a collection of Smalltalk commands. It’s a few hundred lines of Python, so far. Squeakerfile.st is like Dockerfile, except it contains locations to fetch images from…

2
Show HN: Squeaker: Like Docker, but for Smalltalk Images

Like Docker, but for Smalltalk images. You know, for
kids.

It’s a small program that helps in automated derivation of
configured Smalltalk images from some fixed base image and a
collection of Smalltalk commands. It’s a few hundred lines of
Python, so far.

  • Squeakerfile.st is like Dockerfile, except it contains
    locations to fetch images from plus Smalltalk expressions to derive
    new images.

  • squeaker build is like docker build. It manages a cache (in
    $XDG_CACHE_HOME/squeaker, usually $HOME/.cache/squeaker on
    Unix) of downloaded artifacts, derived images, and the stages in
    each derivation.

  • squeaker run is like docker run. It starts a
    previously-downloaded or -derived image in a temporary directory.
    (Future: support persistent image instances, like docker does! Easy
    enough.)

  • squeaker gc is like docker system prune, roughly. It cleans out
    the Squeaker cache directory, treating tags as GC roots.

Installation

Install Python 3.x (I used 3.9 to build it), making sure python3 is
on the PATH.

Make sure squeaker is on the PATH, too.

Usage

You can type “squeaker --help” and “squeaker subcommand
--help” for terse usage information.

Downloading and customising images

The Squeakerfile.st specifying a build is written using
!-delimited chunk format (see also here and
below). A chunk starting with from: specifies either

  • A URL, if the argument to from: is a Smalltalk string literal,
    e.g.

    from: 'http://files.squeak.org/6.0alpha/Squeak6.0alpha-20582-64bit/Squeak6.0alpha-20582-64bit.zip'
    

    The URL must point to a ZIP file containing at least one *.image
    file and a matching *.changes file.

  • A tag, previously defined using squeaker build -t ..., if the
    argument to from is a quoted Smalltalk symbol literal, e.g.

Other chunks are snippets of Smalltalk to execute to configure the
image, deriving another image. Chunks are applied in sequence.
Squeaker caches intermediaries, like Docker does, to avoid repeated
work.

Let’s work with the following Squeakerfile.st:

from: 'http://files.squeak.org/6.0alpha/Squeak6.0alpha-20582-64bit/Squeak6.0alpha-20582-64bit.zip'!

World submorphs
    select: [:m |
        (m isKindOf: PreferenceWizardMorph) or:
            [m isSystemWindow and: [m label beginsWith: 'Welcome to Squeak']]]
    thenDo: [:m | m delete].
!

"Apply my preferences!!"
CommunityTheme createDark apply.
Model useColorfulWindows: true.
[Preferences setDemoFonts] valueSupplyingAnswer: true.
Cursor useBiggerCursors: true.
Preferences enable: #mouseOverForKeyboardFocus.
TextEditor autoEnclose: false.
Model windowActiveOnFirstClick: true.
!

MCMcmUpdater default doUpdate: false.
!

Metacello new configuration: 'FFI'; load.
Installer ss project: 'OSProcess'; install: 'OSProcess'.
!

Use squeaker build to build it. Here, I will tag the final image as
myimage:

>asColorizedSmalltalk80Text (TextSt

NOW WITH OVER +8500 USERS. people can Join Knowasiak for free. Sign up on Knowasiak.com
Read More

Charlie
WRITEN BY

Charlie

Fill your life with experiences so you always have a great story to tell

Leave a Reply