summaryrefslogtreecommitdiff
path: root/docker/utils/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'docker/utils/utils.py')
-rw-r--r--docker/utils/utils.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/docker/utils/utils.py b/docker/utils/utils.py
index 1fce137..89837b7 100644
--- a/docker/utils/utils.py
+++ b/docker/utils/utils.py
@@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import base64
import io
import os
import os.path
@@ -66,6 +67,13 @@ def mkbuildcontext(dockerfile):
return f
+def decode_json_header(header):
+ data = base64.b64decode(header)
+ if six.PY3:
+ data = data.decode('utf-8')
+ return json.loads(data)
+
+
def tar(path, exclude=None, dockerfile=None):
f = tempfile.NamedTemporaryFile()
t = tarfile.open(mode='w', fileobj=f)