diff --git a/app/Main.hs b/app/Main.hs
--- a/app/Main.hs
+++ b/app/Main.hs
@@ -364,7 +364,7 @@
     let fromInstruction =
             toDockerfile $ do
                 let Tag t = buildTag
-                from $ Text.unpack t `tagged` "latest" -- Use the cached image as base for the new one
+                from $ toImage t `tagged` "latest" -- Use the cached image as base for the new one
     doStageBuild app stageTag buildTag fromInstruction
 
 doStageBuild :: App -> Tag a -> Tag b -> Dockerfile -> Shell ()
@@ -397,7 +397,7 @@
     let eitherDirectives = map (parseString . Text.unpack) onBuildLines
         file =
             toDockerfile $ do
-                from (tagged (Text.unpack tag) "latest")
+                from $ toImage tag `tagged` "latest"
                 mapM (onBuildRaw . toInstruction) (rights eitherDirectives) -- Append each of the ONBUILD instructions
     return file
   where
@@ -475,12 +475,12 @@
     extractInfo (InstructionPos {instruction, lineNumber}:_) = getStageInfo instruction lineNumber
     extractInfo _ = Nothing
     getStageInfo :: Instruction -> Linenumber -> Maybe (Text, Linenumber, Text)
-    getStageInfo (From (TaggedImage name _ (Just (ImageAlias alias)))) pos =
-        Just (Text.pack name, pos, Text.pack alias)
-    getStageInfo (From (UntaggedImage name (Just (ImageAlias alias)))) pos =
-        Just (Text.pack name, pos, Text.pack alias)
-    getStageInfo (From (DigestedImage name _ (Just (ImageAlias alias)))) pos =
-        Just (Text.pack name, pos, Text.pack alias)
+    getStageInfo (From (TaggedImage Image {imageName} _ (Just (ImageAlias alias)))) pos =
+        Just (Text.pack imageName, pos, Text.pack alias)
+    getStageInfo (From (UntaggedImage Image {imageName} (Just (ImageAlias alias)))) pos =
+        Just (Text.pack imageName, pos, Text.pack alias)
+    getStageInfo (From (DigestedImage Image {imageName} _ (Just (ImageAlias alias)))) pos =
+        Just (Text.pack imageName, pos, Text.pack alias)
     getStageInfo _ _ = Nothing
     --
     -- | Makes a string safe to use it as a file name
@@ -521,10 +521,12 @@
             Nothing -> directive
             Just Stage {buildTag, stageAlias} ->
                 let Tag t = buildTag
-                in From (TaggedImage (Text.unpack t) "latest" (formatAlias stageAlias))
+                in From (TaggedImage (toImage t) "latest" (formatAlias stageAlias))
     formatAlias = Just . fromString . Text.unpack
 
 printLn message = printf (message % "\n")
+
+toImage = fromString . Text.unpack
 
 needEnv varName = do
     value <- need varName
diff --git a/docker-build-cacher.cabal b/docker-build-cacher.cabal
--- a/docker-build-cacher.cabal
+++ b/docker-build-cacher.cabal
@@ -2,10 +2,10 @@
 --
 -- see: https://github.com/sol/hpack
 --
--- hash: 3c830635dcc41d92b734c4e0c6e51c58f524d11a6f6949f4574af5b8af5d0d58
+-- hash: 5a003d294133fb8cbac4c4b9193cceb6025c8449677be1292089367860a88e82
 
 name:           docker-build-cacher
-version:        1.9.2
+version:        1.9.3
 synopsis:       Builds a services with docker and caches all of its intermediate stages
 description:    A CLI tool to speed up multi-stage docker file builds by caching intermediate
 category:       Operations
@@ -35,7 +35,7 @@
       base >=4.9.1.0 && <5
     , containers
     , foldl
-    , language-docker >=2.0.1 && <3.0
+    , language-docker >=3.0.0 && <4.0
     , system-filepath
     , text
     , turtle
