Giter Club home page Giter Club logo

hledger-docker-versioned's Introduction

Yet Another Dockerized Hledger

This repository contains a Dockerized distribution of the plain-text accounting application Hledger and its associated web application, which is otherwise difficult to install without the prerequisite Haskell environment.

In contrast to existing images, this project has two goals: small image sizes and version pinning for the Hledger applications. The first of these goals is still a work in progress.

Building

You can use the provided Makefile to build the image, e.g. make or, equivalently, make image.

Note that this project uses a two-stage image to separate builder and application environments.

Using the Image

By default, containers will run hledger-web on port 5000. In order to use it with a local ledger journal file, you will need to (1) mount that file at /journal.txt; and (2) map port 5000 in the container to a host port.

For example, if you have the journal file 2018.ledger in the current directory, you can view it in hledger-web at http://localhost:5000 with the following invocation:

$ docker run --name hledger --rm --detach \
             -v "`pwd`/2018.ledger":/journal.txt \
             -p 5000:5000 \
             hledger:1.11.1

When this container is running you can also run reports against this journal file with docker exec, e.g.

$ docker exec hledger hledger balance assets

To run regular hledger reports without a running webserver, you can pass the command directly to docker run, e.g.

$ docker run --rm \
             -v "`pwd`/2018.ledger":/journal.txt \
             hledger:1.11.1 \
             hledger balance assets

If you don't want to mount the ledger journal file, you can make use of hledger -f - to read from standard input:

$ cat 2018.ledger | docker run --rm -i hledger:1.11.1 hledger -f - balance assets

Notes

The two-stage build process used here is inspired by Deni Bertovic's blog post on the subject.

For correctly building Hledger itself I am indebted to the hledger-install.sh script.

hledger-docker-versioned's People

Contributors

atheriel avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.