diff --git a/harpoon/ship/context.py b/harpoon/ship/context.py
index <HASH>..<HASH> 100644
--- a/harpoon/ship/context.py
+++ b/harpoon/ship/context.py
@@ -142,7 +142,17 @@ class ContextBuilder(object):
                         log.debug(stat)
 
                         fo = BytesIO(strm.read())
-                        tf = tarfile.TarFile(fileobj=fo)
+
+                        # In newer docker the archive is a gzipped archive
+                        # But in older docker, it's a normal tar
+                        for mode in ("r:gz", "r"):
+                            try:
+                                tf = tarfile.open(fileobj=fo, mode=mode)
+                                break
+                            except tarfile.ReadError:
+                                if mode == "r":
+                                    raise
+                                fo.seek(0)
 
                         if tf.firstmember.isdir():
                             tf2 = tarfile.TarFile(fileobj=fle, mode='w')
Fix opening tar from docker.get_archive

In newer versions of docker the return of get_archive is a gzipped tar
file, whereas in older dockers it is a normal tar file.

So we try to open it as gzip, which should fail quickly if it's a
normal tar, before trying to read it as a normal tar