sassoftware / viya4-deployment

This project contains Ansible code that creates a baseline in an existing Kubernetes environment for use with the SAS Viya Platform, generates the manifest for an order, and then can also deploy that order into the Kubernetes environment specified.
Apache License 2.0
71 stars 64 forks source link

docker build terminates with an error #248

Closed JimBrousseau closed 10 months ago

JimBrousseau commented 2 years ago

Solution: Added this to Line 3 of the Dockerfile

RUN apt-get update && apt-get install -y apt-transport-https

i.e.

# syntax=docker/dockerfile:experimental
FROM ubuntu:20.04 as baseline
RUN apt-get update && apt-get install -y apt-transport-https
RUN apt update && apt upgrade -y \
  && apt install -y python3 python3-dev python3-pip curl unzip \
  && update-alternatives --install /usr/bin/python python /usr/bin/python3 1 \
  && update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
thpang commented 2 years ago

Ok that item could be added to this line:

  && apt install -y python3 python3-dev python3-pip curl unzip apt-transport-https \

Not sure what the error was or is but if you could share more info. Not sure what the addition of this package actually adds to the baseline and why it's needed.

JimBrousseau commented 2 years ago

Here's the output:

docker build -t viya4-deployment-sasfirdviya4 .
Sending build context to Docker daemon   13.8MB
Step 1/24 : FROM ubuntu:20.04 as baseline
 ---> fb52e22af1b0
Step 2/24 : RUN apt update && apt upgrade -y   && apt install -y python3 python3-dev python3-pip curl unzip   && update-alternatives --install /usr/bin/python python /usr/bin/python3 1   && update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
 ---> Using cache
 ---> f6cea905a0bf
Step 3/24 : FROM baseline as tool_builder
 ---> f6cea905a0bf
Step 4/24 : ARG kustomize_version=3.7.0
 ---> Using cache
 ---> e08e67195ce4
Step 5/24 : ARG kubectl_version=1.22.10
 ---> Using cache
 ---> 69086d227c90
Step 6/24 : WORKDIR /build
 ---> Using cache
 ---> e2c87a90bae8
Step 7/24 : RUN curl -sLO https://storage.googleapis.com/kubernetes-release/release/v{$kubectl_version}/bin/linux/amd64/kubectl && chmod 755 ./kubectl   && curl -sLO https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v${kustomize_version}/kustomize_v${kustomize_version}_linux_amd64.tar.gz && gunzip -c ./kustomize_v${kustomize_version}_linux_amd64.tar.gz | tar xvf - && chmod 755 ./kustomize
 ---> Using cache
 ---> 17936294abfa
Step 8/24 : FROM baseline
 ---> f6cea905a0bf
Step 9/24 : ARG HELM_VERSION=3.8.1
 ---> Using cache
 ---> 4556235b8f22
Step 10/24 : ARG aws_cli_version=2.1.20
 ---> Using cache
 ---> bea7f1fd44f5
Step 11/24 : ARG gcp_cli_version=334.0.0
 ---> Using cache
 ---> 83b5e8d99f8a
Step 12/24 : RUN apt install -y gzip wget git git-lfs jq sshpass   && curl -ksLO https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 && chmod 755 get-helm-3   && ./get-helm-3 --version v$HELM_VERSION --no-sudo   && helm plugin install https://github.com/databus23/helm-diff   && curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-${aws_cli_version}.zip" -o "awscliv2.zip"   && unzip awscliv2.zip   && ./aws/install   && curl -sL https://aka.ms/InstallAzureCLIDeb | bash   && curl "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${gcp_cli_version}-linux-x86_64.tar.gz" -o gcpcli.tar.gz   && tar -xvf gcpcli.tar.gz   && ./google-cloud-sdk/install.sh
 ---> Running in 9ece4ce256e3

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
gzip is already the newest version (1.10-0ubuntu4).
The following additional packages will be installed:
  git-man less libbsd0 libcbor0.6 libcurl3-gnutls libedit2 liberror-perl
  libfido2-1 libjq1 libonig5 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6
  libxext6 libxmuu1 openssh-client xauth
Suggested packages:
  gettext-base git-daemon-run | git-daemon-sysvinit git-doc git-el git-email
  git-gui gitk gitweb git-cvs git-mediawiki git-svn keychain libpam-ssh
  monkeysphere ssh-askpass
The following NEW packages will be installed:
  git git-lfs git-man jq less libbsd0 libcbor0.6 libcurl3-gnutls libedit2
  liberror-perl libfido2-1 libjq1 libonig5 libx11-6 libx11-data libxau6
  libxcb1 libxdmcp6 libxext6 libxmuu1 openssh-client sshpass wget xauth
0 upgraded, 24 newly installed, 0 to remove and 0 not upgraded.
Need to get 11.5 MB of archives.
After this operation, 61.1 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 less amd64 551-1ubuntu0.1 [123 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal/main amd64 libbsd0 amd64 0.10.0-1 [45.4 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal/main amd64 libcbor0.6 amd64 0.6.0-0ubuntu1 [21.1 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal/main amd64 libedit2 amd64 3.1-20191231-1 [87.0 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal/main amd64 libfido2-1 amd64 1.3.1-1ubuntu2 [47.9 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal/main amd64 libxau6 amd64 1:1.0.9-0ubuntu1 [7488 B]
Get:7 http://archive.ubuntu.com/ubuntu focal/main amd64 libxdmcp6 amd64 1:1.1.3-0ubuntu1 [10.6 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal/main amd64 libxcb1 amd64 1.14-2 [44.7 kB]
Get:9 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libx11-data all 2:1.6.9-2ubuntu1.2 [113 kB]
Get:10 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libx11-6 amd64 2:1.6.9-2ubuntu1.2 [575 kB]
Get:11 http://archive.ubuntu.com/ubuntu focal/main amd64 libxext6 amd64 2:1.3.4-0ubuntu1 [29.1 kB]
Get:12 http://archive.ubuntu.com/ubuntu focal/main amd64 libxmuu1 amd64 2:1.1.3-0ubuntu1 [9728 B]
Err:13 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 openssh-client amd64 1:8.2p1-4ubuntu0.3
  404  Not Found [IP: 91.189.91.39 80]
Get:14 http://archive.ubuntu.com/ubuntu focal/main amd64 wget amd64 1.20.3-1ubuntu1 [349 kB]
Get:15 http://archive.ubuntu.com/ubuntu focal/main amd64 xauth amd64 1:1.1-0ubuntu1 [25.0 kB]
Ign:16 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libcurl3-gnutls amd64 7.68.0-1ubuntu2.7
Get:17 http://archive.ubuntu.com/ubuntu focal/main amd64 liberror-perl all 0.17029-1 [26.5 kB]
Ign:18 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 git-man all 1:2.25.1-1ubuntu3.2
Ign:19 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 git amd64 1:2.25.1-1ubuntu3.2
Get:20 http://archive.ubuntu.com/ubuntu focal/universe amd64 git-lfs amd64 2.9.2-1 [3316 kB]
Get:21 http://archive.ubuntu.com/ubuntu focal/universe amd64 libonig5 amd64 6.9.4-1 [142 kB]
Get:22 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 libjq1 amd64 1.6-1ubuntu0.20.04.1 [121 kB]
Get:23 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 jq amd64 1.6-1ubuntu0.20.04.1 [50.2 kB]
Get:24 http://archive.ubuntu.com/ubuntu focal/universe amd64 sshpass amd64 1.06-1 [10.5 kB]
Err:16 http://security.ubuntu.com/ubuntu focal-updates/main amd64 libcurl3-gnutls amd64 7.68.0-1ubuntu2.7
  404  Not Found [IP: 91.189.91.39 80]
Err:18 http://security.ubuntu.com/ubuntu focal-updates/main amd64 git-man all 1:2.25.1-1ubuntu3.2
  404  Not Found [IP: 91.189.91.39 80]
Err:19 http://security.ubuntu.com/ubuntu focal-updates/main amd64 git amd64 1:2.25.1-1ubuntu3.2
  404  Not Found [IP: 91.189.91.39 80]
Fetched 5154 kB in 0s (17.0 MB/s)
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/o/openssh/openssh-client_8.2p1-4ubuntu0.3_amd64.deb  404  Not Found [IP: 91.189.91.39 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/c/curl/libcurl3-gnutls_7.68.0-1ubuntu2.7_amd64.deb  404  Not Found [IP: 91.189.91.39 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/g/git/git-man_2.25.1-1ubuntu3.2_all.deb  404  Not Found [IP: 91.189.91.39 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/g/git/git_2.25.1-1ubuntu3.2_amd64.deb  404  Not Found [IP: 91.189.91.39 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
The command '/bin/sh -c apt install -y gzip wget git git-lfs jq sshpass   && curl -ksLO https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 && chmod 755 get-helm-3   && ./get-helm-3 --version v$HELM_VERSION --no-sudo   && helm plugin install https://github.com/databus23/helm-diff   && curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-${aws_cli_version}.zip" -o "awscliv2.zip"   && unzip awscliv2.zip   && ./aws/install   && curl -sL https://aka.ms/InstallAzureCLIDeb | bash   && curl "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${gcp_cli_version}-linux-x86_64.tar.gz" -o gcpcli.tar.gz   && tar -xvf gcpcli.tar.gz   && ./google-cloud-sdk/install.sh' returned a non-zero code: 100
JimBrousseau commented 2 years ago

Thomas,

Your change also worked.

thpang commented 2 years ago

What version of docker are you using? Asking as I have no issues with building. Sometimes the providers can be updating their repos and docker builds will fail. I would try again without your addition and see if it works. Also be sure to prune your docker env periodically in order to keep the disk clean on your build system.

JimBrousseau commented 2 years ago

Docker version 20.10.17, build 100c701

thpang commented 2 years ago

I am using 20.10.16 with no issues. Thanks for the quick responses.

wweghe commented 2 years ago

Hi @thpang @JimBrousseau , I'm running docker 20.10.18, and ran into the same problem Also changed line 3 with the extra package, and it's working now for me. Thanks, Wouter.

dhoucgitter commented 10 months ago

Marking as stale/inactive. If there are additional questions, please open a new Github issue.

dhoucgitter commented 10 months ago

Closing #248 as completed.