as per https://docs.github.com/en/actions/sharing-automations/creating-actions/creating-a-docker-container-action
22 lines
1.2 KiB
Docker
22 lines
1.2 KiB
Docker
# Container image that runs your code
|
|
FROM debian:12.8-slim
|
|
|
|
# compare https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/
|
|
RUN apt-get update && \
|
|
export DEBIAN_FRONTEND=noninteractive && \
|
|
apt-get install --no-install-recommends -y git nodejs gpg npm dnsutils \
|
|
apt-transport-https ca-certificates curl gnupg # packages in this line required for kubectl && \
|
|
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.32/deb/Release.key | gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg && \
|
|
chmod 644 /etc/apt/keyrings/kubernetes-apt-keyring.gpg && \
|
|
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.32/deb/ /' | tee /etc/apt/sources.list.d/kubernetes.list && \
|
|
chmod 644 /etc/apt/sources.list.d/kubernetes.list # helps tools such as command-not-found to work correctly && \
|
|
apt-get update && apt-get install -y kubectl && \
|
|
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
|
|
# Copies your code file from your action repository to the filesystem path `/` of the container
|
|
COPY entrypoint.sh /entrypoint.sh
|
|
|
|
# Code file to execute when the docker container starts up (`entrypoint.sh`)
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
|