# Use the official Docker image as a parent image
FROM docker:latest
# Install dependencies
RUN apk add --no-cache \
curl \
git \
bash \
nodejs \
npm
# Install kubectl
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" \
&& chmod +x kubectl \
&& mv kubectl /usr/local/bin/
# Install Krew
RUN ( set -x; cd "$(mktemp -d)" && \
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/krew.tar.gz" && \
tar zxvf krew.tar.gz && \
KREW=./krew-"$(uname | tr '[:upper:]' '[:lower:]')_amd64" && \
"$KREW" install krew )
# Add Krew to the PATH
ENV PATH="${PATH}:/root/.krew/bin"
# Verify installations
RUN docker --version
RUN kubectl version --client
RUN node --version
RUN npm --version
# Your application code or other setup steps can go here...
CMD [ "bash" ]
docker build -t myimage .
docker run -it --rm myimage