Skip to content

Instantly share code, notes, and snippets.

@dzackgarza
Last active August 29, 2015 14:21
Show Gist options
  • Save dzackgarza/149eb72a6ab6ec5b23dd to your computer and use it in GitHub Desktop.
Save dzackgarza/149eb72a6ab6ec5b23dd to your computer and use it in GitHub Desktop.
Hackage and cabal repl in docker container
---------------- Terminal 1 ----------------------------
╰─$ sudo docker -d
INFO[0000] Listening for HTTP on unix (/var/run/docker.sock)
INFO[0000] [graphdriver] using prior storage driver "devicemapper"
INFO[0000] Loading containers: start.
................
INFO[0001] Loading containers: done.
INFO[0001] Daemon has completed initialization
INFO[0001] Docker daemon commit=628c396 execdriver=native-0.2 graphdriver=devicemapper version=1.7.0-dev
INFO[0016] POST /v1.19/containers/create
INFO[0019] POST /v1.19/containers/d7cc5e3a27b409bf7f909c6ad9b636ca4905d128039d1b36dea47c9d0c99da1b/start
INFO[0020] GET /v1.19/containers/d7cc5e3a27b409bf7f909c6ad9b636ca4905d128039d1b36dea47c9d0c99da1b/json
INFO[0020] GET /v1.19/containers/d7cc5e3a27b409bf7f909c6ad9b636ca4905d128039d1b36dea47c9d0c99da1b/json
INFO[0022] POST /v1.19/containers/create
INFO[0025] POST /v1.19/containers/088fdc0f51f921bce2d34c245dd7d989d2f31e6da678cd1bc2a5d84367d8b14a/start
---------------- Terminal 2 ----------------------------
╰─$ sh run-docker.sh
088fdc0f51f921bce2d34c245dd7d989d2f31e6da678cd1bc2a5d84367d8b14a
You can access your local hackage at http://localhost:0.0.0.0:32768
╰─$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
088fdc0f51f9 zsol/hackage-server "sh -c 'echo -e \"ad 6 minutes ago Up 5 minutes backstabbing_elion
d7cc5e3a27b4 zsol/hackage-server "sh -c './dist/build 6 minutes ago Up 6 minutes 0.0.0.0:32768->8080/tcp naughty_curie
╰─$ sudo docker exec -it naughty_curie bash
root@d7cc5e3a27b4:~/hackage-server-master# cabal repl
Preprocessing executable 'hackage-server' for hackage-server-0.3...
GHCi, version 7.6.3: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package split-0.2.2 ... linking ... done.
Loading package tokenize-0.1.3 ... linking ... done.
Loading package array-0.4.0.1 ... linking ... done.
Loading package deepseq-1.3.0.1 ... linking ... done.
Loading package bytestring-0.10.0.2 ... linking ... done.
Loading package filepath-1.3.0.1 ... linking ... done.
Loading package old-locale-1.0.0.5 ... linking ... done.
Loading package time-1.4.0.1 ... linking ... done.
Loading package unix-2.6.0.1 ... linking ... done.
Loading package directory-1.2.0.1 ... linking ... done.
Loading package old-time-1.1.0.1 ... linking ... done.
Loading package tar-0.4.0.1 ... linking ... done.
Loading package text-0.11.3.1 ... linking ... done.
Loading package text-icu-0.6.3.5 ... linking ... done.
Loading package snowball-1.0.0.1 ... linking ... done.
Loading package containers-0.5.0.0 ... linking ... done.
Loading package polyparse-1.9 ... linking ... done.
Loading package pretty-1.1.1.0 ... linking ... done.
Loading package random-1.0.1.1 ... linking ... done.
Loading package HaXml-1.23.3 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package mtl-2.1.2 ... linking ... done.
Loading package parsec-3.1.3 ... linking ... done.
Loading package network-2.4.1.2 ... linking ... done.
Loading package rss-3000.2.0.2 ... linking ... done.
Loading package binary-0.5.1.1 ... linking ... done.
Loading package cereal-0.3.5.2 ... linking ... done.
Loading package entropy-0.2.2.2 ... linking ... done.
Loading package tagged-0.7 ... linking ... done.
Loading package crypto-api-0.12.2.2 ... linking ... done.
Loading package pureMD5-2.1.2.1 ... linking ... done.
Loading package base64-bytestring-1.0.0.1 ... linking ... done.
Loading package blaze-builder-0.3.1.1 ... linking ... done.
Loading package process-1.1.0.2 ... linking ... done.
Loading package mime-mail-0.4.2.1 ... linking ... done.
Loading package blaze-markup-0.5.1.5 ... linking ... done.
Loading package blaze-html-0.6.1.1 ... linking ... done.
Loading package extensible-exceptions-0.1.1.4 ... linking ... done.
Loading package hslogger-1.2.3 ... linking ... done.
Loading package html-1.0.1.2 ... linking ... done.
Loading package base-unicode-symbols-0.2.2.4 ... linking ... done.
Loading package transformers-base-0.4.1 ... linking ... done.
Loading package monad-control-0.3.2.1 ... linking ... done.
Loading package sendfile-0.7.9 ... linking ... done.
Loading package syb-0.4.0 ... linking ... done.
Loading package system-filepath-0.4.7 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package stm-2.4.2 ... linking ... done.
Loading package threads-0.5.0.2 ... linking ... done.
Loading package time-compat-0.1.0.3 ... linking ... done.
Loading package utf8-string-0.3.7 ... linking ... done.
Loading package xhtml-3000.2.1 ... linking ... done.
Loading package zlib-0.5.4.1 ... linking ... done.
Loading package happstack-server-7.1.7.1 ... linking ... done.
Loading package csv-0.1.2 ... linking ... done.
Loading package base16-bytestring-0.1.1.5 ... linking ... done.
Loading package async-2.0.1.4 ... linking ... done.
Loading package attoparsec-0.10.4.0 ... linking ... done.
Loading package dlist-0.5 ... linking ... done.
Loading package hashable-1.1.2.5 ... linking ... done.
Loading package unordered-containers-0.2.3.0 ... linking ... done.
Loading package primitive-0.5.0.1 ... linking ... done.
Loading package vector-0.10.0.1 ... linking ... done.
Loading package aeson-0.6.2.0 ... linking ... done.
Loading package safecopy-0.8.2 ... linking ... done.
Loading package acid-state-0.8.3 ... linking ... done.
Loading package nats-0.1 ... linking ... done.
Loading package semigroups-0.9.2 ... linking ... done.
Loading package void-0.6.1 ... linking ... done.
Loading package HStringTemplate-0.7.1 ... linking ... done.
Loading package Cabal-1.16.0 ... linking ... done.
Loading object (dynamic) /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libcrypt.so ... done
final link ... done
Ok, modules loaded: Main, Distribution.Server, Distribution.Server.Framework, Distribution.Server.Framework.Feature, Distribution.Server.Framework.Logging, Distribution.Server.Framework.BackupRestore, Distribution.Server.Framework.BackupDump, Distribution.Server.Framework.BlobStorage, Distribution.Server.Util.GZip, Paths_hackage_server, Distribution.Server.Framework.MemSize, Distribution.Server.Util.Parse, Distribution.Server.Util.Merge, Distribution.Server.Framework.Resource, Distribution.Server.Util.Happstack, Distribution.Server.Util.ContentType, Distribution.Server.Framework.Error, Distribution.Server.Framework.Auth, Distribution.Server.Framework.Templating, Distribution.Server.Framework.AuthTypes, Distribution.Server.Features, Distribution.Server.Features.Users, Distribution.Server.Users.Types, Distribution.Server.Users.Users, Distribution.Server.Users.Group, Distribution.Server.Framework.Instances, Distribution.Server.Users.State, Distribution.Server.Users.Backup, Distribution.Server.Framework.AuthCrypt, Distribution.Server.Framework.MemState, Distribution.Server.Framework.Cache, Distribution.Server.Framework.ServerEnv, Distribution.Server.Framework.RequestContentTypes, Distribution.Server.Framework.ResponseContentTypes, Distribution.Server.Framework.Hook, Distribution.Server.Features.StaticFiles, Distribution.Server.Features.Core, Distribution.Server.Features.Upload, Distribution.Server.Features.Mirror, Distribution.Server.Features.TarIndexCache, Distribution.Server.Features.Html, Distribution.Server.Features.PackageCandidates, Distribution.Server.Features.RecentPackages, Distribution.Server.Features.Distro, Distribution.Server.Features.PackageContents, Distribution.Server.Features.Documentation, Distribution.Server.Features.BuildReports, Distribution.Server.Features.LegacyRedirects, Distribution.Server.Features.PreferredVersions, Distribution.Server.Features.DownloadCount, Distribution.Server.Features.Tags, Distribution.Server.Features.Search, Distribution.Server.Features.PackageList, Distribution.Server.Features.HaskellPlatform, Distribution.Server.Features.UserDetails, Distribution.Server.Features.UserSignup, Distribution.Server.Features.LegacyPasswds, Distribution.Server.Features.EditCabalFiles, Distribution.Server.Features.ServerIntrospect, Distribution.Server.Packages.PackageIndex, Distribution.Server.Pages.Template, Distribution.Server.Packages.Types, Distribution.Server.Features.Upload.State, Distribution.Server.Features.Upload.Backup, Distribution.Server.Packages.Unpack, Distribution.Server.Features.Core.State, Distribution.Server.Features.Core.Backup, Distribution.Server.Packages.Index, Distribution.Server.Util.Index, Distribution.Server.Features.LegacyPasswds.Auth, Distribution.Server.Features.HaskellPlatform.State, Distribution.Server.Util.CountingMap, Distribution.Server.Features.PreferredVersions.State, Distribution.Server.Features.PreferredVersions.Backup, Distribution.Server.Features.Tags.State, Distribution.Server.Features.Tags.Backup, Distribution.Server.Packages.Render, Distribution.Server.Packages.ModuleForest, Distribution.Server.Features.DownloadCount.State, Distribution.Server.Features.DownloadCount.Backup, Distribution.Server.Features.Search.PkgSearch, Distribution.Server.Features.Search.SearchEngine, Distribution.Server.Features.Search.SearchIndex, Distribution.Server.Features.Search.DocIdSet, Distribution.Server.Features.Search.DocTermIds, Distribution.Server.Features.Search.BM25F, Distribution.Server.Features.Search.TermBag, Distribution.Server.Features.Search.ExtractNameTerms, Distribution.Server.Features.Search.ExtractDescriptionTerms, Distribution.Server.Pages.Package, Distribution.Server.Pages.Package.HaddockHtml, Distribution.Server.Pages.Package.HaddockParse, Distribution.Server.Pages.Package.HaddockLex, Distribution.Server.Features.BuildReports.Backup, Distribution.Server.Features.BuildReports.State, Distribution.Server.Features.BuildReports.BuildReport, Distribution.Server.Features.BuildReports.BuildReports, Distribution.Server.Features.Documentation.State, Distribution.Server.Util.ServeTarball, Data.TarIndex, Data.StringTable, Data.IntTrie, Distribution.Server.Features.TarIndexCache.State, Distribution.Server.Packages.ChangeLog, Distribution.Server.Features.Distro.State, Distribution.Server.Features.Distro.Types, Distribution.Server.Features.Distro.Backup, Distribution.Server.Features.Distro.Distributions, Distribution.Server.Pages.Recent, Distribution.Server.Features.PackageCandidates.Types, Distribution.Server.Features.PackageCandidates.State, Distribution.Server.Features.PackageCandidates.Backup, Distribution.Server.Pages.Util, Distribution.Server.Pages.Group, Distribution.Server.Pages.Index.
Prelude Main>
root@d7cc5e3a27b4:~/hackage-server-master# ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.3
root@d7cc5e3a27b4:~/hackage-server-master# cabal --version
cabal-install version 1.18.0.1
using version 1.18.0 of the Cabal library
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment