Add-on apk Help

Hi,

First stab at making an add-on using the new base image (homeassistant/armhf-base:latest), in the dockerfile when it hits “RUN apk add --no-cache git” it returns an error code: 1. If I do it with wget, it works fine. I’ve looked at the alpine package list and “git” is there.

Error:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 421, in start
    resp = yield from self._request_handler(request)
  File "/usr/lib/python3.6/site-packages/aiohttp/web.py", line 303, in _handle
    resp = yield from handler(request)
  File "/usr/lib/python3.6/site-packages/hassio/api/util.py", line 30, in wrap_api
    answer = await method(api, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/hassio/api/addons.py", line 98, in install
    self.addons.install(addon, version), loop=self.loop)
  File "/usr/lib/python3.6/site-packages/hassio/addons/__init__.py", line 128, in install
    if not await addon_docker.install(version):
  File "/usr/lib/python3.6/site-packages/hassio/dock/__init__.py", line 55, in install
    return await self.loop.run_in_executor(None, self._install, tag)
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/hassio/dock/addon.py", line 130, in _install
    return self._build(tag)
  File "/usr/lib/python3.6/site-packages/hassio/dock/addon.py", line 173, in _build
    path=str(build_dir), tag=build_tag, pull=True)
  File "/usr/lib/python3.6/site-packages/docker/models/images.py", line 172, in build
    raise BuildError(chunk['error'])
docker.errors.BuildError: The command '/bin/sh -c apk add --no-cache git' returned a non-zero code: 1

Dockerfile:


ENV LANG C.UTF-8

# Setup base
RUN apk add --no-cache git

CMD [ "/run.sh" ]

Maby a temporary problem on alpine packages server?

Oh I need catch this exception :slight_smile:

I went ahead and tried to just set up a pre-built container. Using the script that is also failing with:

[INFO] start docker build
[INFO] Setup crosscompiling feature
update-binfmts: warning: qemu-arm already enabled in kernel.
update-binfmts: warning: qemu-aarch64 already enabled in kernel.
[INFO] Starting docker.
[INFO] Waiting for docker to initialize...
[INFO] Docker was initialized
[INFO] Running build...
invalid argument ":1.0" for --tag: Error parsing reference: ":1.0" is not a valid repository/tag: invalid reference format
See 'docker build --help'.

Looks like the script is just pulling the version from the config.json and trying to use that.

Edit: This was my fault.