appc / docker2aci

library and CLI tool to convert Docker images to ACIs (archived, see https://github.com/rkt/rkt/issues/4024)
Apache License 2.0
186 stars 60 forks source link

environment variable does not have valid identifier #244

Open dohnto opened 7 years ago

dohnto commented 7 years ago

Hello, I have encountered a edge-case where docker image cannot be converted to aci:

# docker2aci --version
docker2aci version 9cec4de
appc version 0.8.10

Docker image was created using following Dockerfile:

FROM busybox
ENV A-B=10

I have push the image to dohnto/docker2aci-env:1.0 for maintainers to verify the bug.

# ./docker2aci docker://dohnto/docker2aci-env:1.0
Downloading sha256:fdab1243926 [===============================] 670 KB / 670 KB
Error: conversion error: error generating ACI: error writing manifest: json: error calling MarshalJSON for type schema.ImageManifest: json: error calling MarshalJSON for type *types.App: environment variable does not have valid identifier "A-B"

Expected result: don't fail :)

lucab commented 7 years ago

The problem is that such an environment name is outside of POSIX portable set, and appc tries to stick to it. See https://github.com/coreos/rkt/issues/3532#issuecomment-272837109 for more details.