It might be simple question but I could not find the proper solution.
I have a Docker image as below.. The things that I would like to do simply run curl command inside kubernetes pod but I received an error as below.. I could not able to exec via bash also.
$ kubectl exec -ti hub-cronjob-dev-597cc575f-6lfdc -n hub-dev sh Defaulting container name to hub-cronjob. Use 'kubectl describe pod/hub-cronjob-dev-597cc575f-6lfdc -n hub-dev' to see all of the containers in this pod. /usr/src/app $ curl sh: curl: not found
Tried with bash
$ kubectl exec -ti cronjob-dev-597cc575f-6lfdc -n hub-dev bash mand in container: failed to exec in container: failed to start exec "8019bd0d92aef2b09923de78753eeb0c8b60a78619543e4cd27069128a30da92": OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: "bash": executable file not found in $PATH": unknown
FROM node:12-alpine AS builder # Variables from outside ARG NODE_ENVIRONMENT=development ENV NODE_ENV=$NODE_ENVIRONMENT # Create app directory WORKDIR /usr/src/app #Install curl RUN apk --no-cache add curl -> did not work RUN apk update && apk add curl curl-dev bash -> did not work # Install app dependencies COPY package*.json ./ RUN npm install # Bundle app source COPY . . # Build Stage 2 # Take the build from the previous stage FROM node:12-alpine WORKDIR /usr/src/app COPY --from=builder /usr/src/app /usr/src/app # run the application EXPOSE 50005 9183 CMD [ "npm", "run", "start:docker" ]
Source: Docker Questions