FROM centos:7
# Install runtime/build dependencies required by the project build process
RUN yum -y update && \
yum -y install bash curl coreutils diffutils grep openssl sed make tar gcc && \
yum clean all
# Prepare application source directory
RUN mkdir -p /app
WORKDIR /app
# Copy repository source
COPY . /app
# Build the project from source
RUN make all
# Default to an interactive shell to explore/run the container
CMD ["bash"]
Summary:
- Exact error message and exit code
- ERROR: failed to build: failed to solve: process "/bin/sh -c yum -y update && yum -y install bash curl coreutils diffutils grep openssl sed make tar gcc && yum clean all" did not complete successfully: exit code: 1
- Also present in logs:
- Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=container error was
- 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
- Cannot find a valid baseurl for repo: base/7/x86_64
- Failing command/step
- RUN yum -y update && yum -y install bash curl coreutils diffutils grep openssl sed make tar gcc && yum clean all
- Missing packages or files mentioned
- The failure is due to unreachable CentOS 7 repositories:
- Could not resolve host: mirrorlist.centos.org
- Cannot find a valid baseurl for repo: base/7/x86_64
- Version mismatch info
- Base image used: centos:7
- The error indicates CentOS 7 repos are inaccessible/unresolvable (baseurl for base/7/x86_64 cannot be found), which points to repository availability/dns issues rather than a specific package version mismatch.# Multi-stage build: build from source on Ubuntu 20.04, then provide a lightweight runtime image
FROM ubuntu:20.04 as builder
ENV DEBIAN_FRONTEND=noninteractive
# Install build dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
curl \
diffutils \
grep \
openssl \
sed \
make \
tar \
gcc \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY . /app
# Build the project from source
RUN make all
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
# Install runtime dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
bash \
curl \
coreutils \
diffutils \
grep \
openssl \
sed \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy built artifacts and source from builder
COPY --from=builder /app/build /app/build
COPY --from=builder /app /app
CMD ["bash"]
- Exact error message and exit code
- curl: (77) error setting certificate verify locations:
CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
- make: *** [Makefile:69: /app/build/stamp-dehydrated-2-05eda91a2fbaed1e13c733230238fc68475c535e] Error 77
- Failing step exit for the whole RUN: 2
- The container reports: ERROR: process "/bin/sh -c make all" did not complete successfully: exit code: 2
- Failing command/step
- Failing step: builder 5/5 RUN make all
- Inside this step, the curl command that downloads dehydrated failed:
curl -sSLo /app/build/bin/dehydrated "https://raw.githubusercontent.com/lukas2511/dehydrated/05eda91a2fbaed1e13c733230238fc68475c535e/dehydrated"
- Result: curl returned exit code 77, causing make to fail with Error 77
- Missing packages or files mentioned
- Caused by missing CA certificates, since CAfile points to /etc/ssl/certs/ca-certificates.crt
- Likely missing package: ca-certificates (not installed in the apt-get install step)
- Version mismatch/info
- Base image used: ubuntu:20.04
- Notable warning: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 2) in the Dockerfile
- libc6 was upgraded during apt-get install (unpacked/set up libc6:amd64 (2.31-0ubuntu9.18) after replacing 2.31-0ubuntu9.17)# Multi-stage build for lua-resty-auto-ssl project FROM ubuntu:22.04 as builder ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ curl \ diffutils \ grep \ openssl \ sed \ make \ tar \ gcc \ ca-certificates \ && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY . /app RUN make all FROM ubuntu:22.04 ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y --no-install-recommends \ bash \ curl \ coreutils \ diffutils \ grep \ openssl \ sed \ ca-certificates \ && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY --from=builder /app /app CMD ["bash"]
Smoke [PASS]: test -d /app && echo app_dir_ok Smoke [PASS]: ls -la /app | head -n 5