Skip to content

A project template for quickly working with the Crystal programming language in a Docker container, no installation needed.

License

Notifications You must be signed in to change notification settings

compumike/crystal-docker-quickstart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crystal-docker-quickstart

crystal-docker-quickstart provides a project template for quickly working with the Crystal programming language in a container, with no installation necessary.

Usage

  1. (Fork and/or) clone this repository, and give it a name for your project: git clone https://github.com/compumike/crystal-docker-quickstart.git my_app
  2. cd my_app
  3. Run ./d_dev to open a bash shell with a Docker container containing this directorye mounted in /app/ (see source in /app/src/, unit tests in /app/spec/, and compiled output in /app/out/).

Within the Docker container, you may run:

    # To run unit tests:
    make spec

    # To rebuild your compiled binary, which lives in /app/out/my_app
    make

    # To rebuild the binary, and run it:
    make && out/my_app

You may edit your source code from another terminal session or your favorite IDE. (The d_dev script mounts this directory into the container.)

Good luck and enjoy! :)

Next Steps

You may wish to edit some configuration within Dockerfile, d_dev, or Makefile, for example to expose TCP ports, enable compiler release optimizations, or rename your binary to something other than my_app.

If you'd like to incorporate a dependency, known as a "Shard" in the crystal world, first edit shard.yml, and then run shards install within the Docker container.

Resources

About

A project template for quickly working with the Crystal programming language in a Docker container, no installation needed.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published