'/bin/sh: 1: apk: not found (when using jenkins/agent:latest-jdk11)
I have this Dockerfile:
FROM jenkins/agent:latest-jdk11
RUN apk --no-cache add curl
But when I try and build it I get:
Sending build context to Docker daemon 2.048kB
Step 1/2 : FROM jenkins/agent:latest-jdk11
---> 6f9ed88cf9cc
Step 2/2 : RUN apk --no-cache add curl
---> Running in 2f0f9c1279b6
/bin/sh: 1: apk: not found
As I understand apk is the package management for Alpine images. Looking at the base image:
docker inspect jenkins/agent:latest-jdk11
I see the following labels:
"Labels": {
"Description": "This is a base image, which provides the Jenkins agent executable (agent.jar)",
"Vendor": "Jenkins project",
"Version": "4.10",
"org.opencontainers.image.description": "This is a base image, which provides the Jenkins agent executable (agent.jar)",
"org.opencontainers.image.licenses": "MIT",
"org.opencontainers.image.source": "https://github.com/jenkinsci/docker-agent",
At that location there is indeed an alpine version of the image:
https://github.com/jenkinsci/docker-agent/blob/master/11/alpine/Dockerfile
but apparently that is not what jenkins/agent:latest-jdk11 is based on. So how do I find out which distro jenkins/agent:latest-jdk11 is?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
