heyvito / podman-macos

📦 Podman frontend for macOS
MIT License
560 stars 12 forks source link

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

Closed symgryph closed 3 years ago

symgryph commented 3 years ago

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
symgryph commented 3 years ago

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.

heyvito commented 3 years ago

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: https://github.com/containers/podman/issues/11530#issuecomment-917564959

spike014 commented 2 years ago

In Mac OS, that was what I done: