最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

azure - Docker File testing in DockerDesktop with terraform installation - Stack Overflow

programmeradmin5浏览0评论

I am trying to test the docker file in local through docker desktop but it not completing successfully but same dockerFile is working through ado pipeline and I am able to build and publish the image to repo. but Not able to test in locally by building it . can some one help me. here is docker file content

# Use a base Ubuntu image
FROM ubuntu:22.04

# Set environment variables
ENV TARGETARCH="linux-x64"

# Update apt cache and install required packages
RUN apt-get update && \
    apt-get install -y \
        git \
        build-essential \
        unzip \
        lxc \
        wget \
        gpg \
        iptables \
        sudo \
        jq \
        libicu70 \
        bc \
        bash \
        iputils-ping \
        gnupg \
        lsb-release \
        telnet \
        ssh \
        nodejs \
        npm \
        gcc \
        sshpass \
        curl && \
    rm -rf /var/lib/apt/lists/*

# Install Azure CLI
RUN curl -sL  | bash

ARG TERRAFORM_VERSION=1.3.1

RUN wget -q "/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip" -O tf.zip && \
    unzip tf.zip && \
    mv ./terraform /usr/local/bin/terraform && \
    chmod +x /usr/local/bin/terraform && \
    rm tf.zip

# Expose SSH and any other ports as necessary
EXPOSE 22

# Set working directory
WORKDIR /azp/

# Copy start script
COPY ./start.sh ./ 
RUN chmod +x ./start.sh

# Create agent user and set up home directory
RUN useradd -m -d /home/agent agent
RUN chown -R agent:agent /azp /home/agent

USER agent
# Another option is to run the agent as root.

ENTRYPOINT [ "./start.sh" ]

and getting error in terminal is as follow

 => ERROR [4/9] RUN wget -q ".3.1/terraform_1.3.1_linux_amd64.zip" -O tf.zip &&     unzip tf.zip &&     mv ./terraform /usr/local/bin/terraform &&     chmod +x /usr/local/bin  0.5s
------
 > [4/9] RUN wget -q ".3.1/terraform_1.3.1_linux_amd64.zip" -O tf.zip &&     unzip tf.zip &&     mv ./terraform /usr/local/bin/terraform &&     chmod +x /usr/local/bin/terraform &&     rm tf.zip:
------
Dockerfile:47
--------------------
  46 |
  47 | >>> RUN wget -q "/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip" -O tf.zip && \
  48 | >>>     unzip tf.zip && \
  49 | >>>     mv ./terraform /usr/local/bin/terraform && \
  50 | >>>     chmod +x /usr/local/bin/terraform && \
  51 | >>>     rm tf.zip
  52 |
--------------------
ERROR: failed to solve: process "/bin/sh -c wget -q \"/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip\" -O tf.zip &&     unzip tf.zip &&     mv ./terraform /usr/local/bin/terraform &&     chmod +x /usr/local/bin/terraform &&     rm tf.zip" did not complete successfully: exit code: 5
发布评论

评论列表(0)

  1. 暂无评论