containers / build

another build tool for container images (archived, see https://github.com/rkt/rkt/issues/4024)
Apache License 2.0
342 stars 80 forks source link

ERROR: ACName must contain only lower case alphanumeric characters plus "-" #282

Closed DJviolin closed 7 years ago

DJviolin commented 7 years ago

I'm getting this errror:

Adding mount point "/var/lib/container/rkt/debian"="/mnt"
mount add: ACName must contain only lower case alphanumeric characters plus "-"

From this commands:

$ acbuild --debug mount add $(pwd) /mnt
# or
$ acbuild --debug mount add . /mnt

System info:

$ acbuild version
acbuild version v0.4.0
appc version 0.8.5
$ uname -a
Linux debian 4.8.0-0.bpo.2-amd64 #1 SMP Debian 4.8.11-1~bpo8+1 (2016-12-14) x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 8.6 (jessie)
Release:        8.6
Codename:       jessie
jonboulle commented 7 years ago

The "mount" concept in ACIs is a bit different from what you might be used to with Docker volumes; basically rather than a sourcePath -> destPath mapping, it's instead a name -> destPath mapping where the name is an index into a set of volumes that the running pod is configured with. (The idea being that the specific source-path on the host is really a runtime parameter rather than something you want to predetermine at build time).

This is explained with some relevant examples in the rkt documentation: https://coreos.com/rkt/docs/latest/subcommands/run.html#mounting-volumes

So in your particular example you might want something like:

acbuild mount add my-debian-vol mnt`
<write the image>
rkt run --volume my-debian-vol,kind=host 

(Or you could just skip adding the mount to the ACI at all during the build, and just specify it during the running of the image.)

Does that help?

DJviolin commented 7 years ago

Thank You! That's clearing things out.

So I have to write something like this?

$ acbuild --debug mount add my-named-vol /mnt
# ...
$ rkt run --volume my-named-vol,kind=host,source=$(pwd),readOnly=true debian.aci
jonboulle commented 7 years ago

Yep, exactly!