Skip to content

Base Image in Dockerfile has Changed #12158

Closed
@ptMcGit

Description

@ptMcGit
Description

Docker fails to build image from Dockerfile.

Swagger-codegen version

n/a

Swagger declaration file content or url

n/a

Command line used for generation

n/a

Steps to reproduce
docker build ./                                  
[+] Building 0.4s (6/16)                                                                                                                    
 => [internal] load .dockerignore                                                                                                      0.0s 
 => => transferring context: 310B                                                                                                      0.0s 
 => [internal] load build definition from Dockerfile                                                                                   0.0s 
 => => transferring dockerfile: 1.17kB                                                                                                 0.0s 
 => [internal] load metadata for docker.io/library/maven:3-eclipse-temurin-11                                                          0.0s 
 => CACHED [ 1/12] FROM docker.io/library/maven:3-eclipse-temurin-11                                                                   0.0s 
 => [internal] load build context                                                                                                      0.4s 
 => => transferring context: 10.87MB                                                                                                   0.3s 
 => ERROR [ 2/12] RUN set -x &&     apk add --no-cache bash                                                                            0.4s 
------                                                                                                                                      
 > [ 2/12] RUN set -x &&     apk add --no-cache bash:                                                                                       
#0 0.320 + apk add --no-cache bash                                                                                                          
#0 0.320 /bin/sh: 1: apk: not found                                                                                                         
------                                                                                                                                      
Dockerfile:3                                                                                                                                
--------------------                                                                                                                        
   2 |                                                                                                                                      
   3 | >>> RUN set -x && \                                                                                                                  
   4 | >>>     apk add --no-cache bash                                                                                                      
   5 |                                                                                                                                      
--------------------                                                                                                                        
ERROR: failed to solve: process "/bin/sh -c set -x &&     apk add --no-cache bash" did not complete successfully: exit code: 127 
Related issues/PRs

None found.

Suggest a fix/enhancement

The base image maven:3-eclipse-temurin-11 here is not alpine so apk is not found.

Update the line with maven:3-eclipse-temurin-11-alpine to explicitly ask for the alpine image.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions