heyvito / podman-macos

📦 Podman frontend for macOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

running on catalina after install: Error: error creating build container: short-name resolution enforced but cannot prompt without a TTY

symgryph opened this issue · comments

I am running 'currentest' (as of this writing) and when I try to build I get the following error:

Error: error creating build container: short-name resolution enforced but cannot prompt without a TTY

command is:
podman build -t myfile:latest .

Dockerfile:

FROM golang:1.16.7-alpine3.14 as builder
ENV GO111MODULE=auto
ENV LDFLAGS="-s -w"
RUN apk add --no-cache \
    git \
    ca-certificates \
    upx
RUN mkdir -p /usr/src/ &&\
    cd /usr/src && \
    git clone https://www.github.com/caddyserver/xcaddy.git && \
    cd xcaddy/cmd/xcaddy && \
    go build && \
    ./xcaddy build --with github.com/caddy-dns/cloudflare --with github.com/caddy-dns/lego-deprecated && \
    upx --lzma caddy
FROM alpine:3.14
COPY --from=builder /usr/src/xcaddy/cmd/xcaddy/caddy /bin/
RUN mkdir /output
CMD cp /bin/caddy /output/caddy

I figured it out. you have to specify the registry to pull form (short names don't seem to work). So your "FROM" must specify the registry in front of it (for anyone else having trouble with dns short name resolution). This seems to be a podman issue that was recently fixed.

FROM docker.io/golang:1.16.7-alpine3.14 as builder
ENV GO111MODULE=auto

This will fix the error.

Hey @symgryph! As you figured out, this is a Podman issue; you can find further info here. The "cannot prompt without a TTY" is because podman is communicating with its runtime that lives inside the virtual machine. You can also file an issue at containers/podman, but the fine folks from Red Hat already mentioned this here: containers/podman#11530 (comment)

In Mac OS, that was what I done:

  • ssh into the virtual machine
podman machine ssh
  • Edit the file /etc/containers/registries.conf
vi /etc/containers/registries.conf
  • Change short-name-mode="enforcing" to short-name-mode="permissive"