Open reevelau opened 4 years ago
Sorry for neglecting the issues here! I didn't include it because it depended on a few local files I didn't want to stick in git, but here is what I used if you want to adapt it for your purposes. It's easiest to work from a base footloose image.
FROM quay.io/footloose/debian10:0.6.3
RUN sudo apt-get update; \
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y aptitude python2.7 python-setuptools apt-transport-https ca-certificates curl wget time software-properties-common python3-pip virtualenv python3-setuptools gnupg gnupg-agent tcpdump ngrep tshark silversearcher-ag-el bpfcc-tools ipython fish fzf vim dnsutils jq golang-go git libpcap0.8 libpcap0.8-dev bridge-utils; \
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -; \
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"; \
sudo apt-get update; sudo DEBIAN_FRONTEND=noninteractive apt-get install -y docker-ce docker-ce-cli containerd.io && rm -rf /var/lib/apt/lists/*
# this is to avoid confusing people with two iptables commands
RUN update-alternatives --set iptables /usr/sbin/iptables-legacy
RUN chsh -s $(which fish)
RUN sudo mkdir -p /var/lib/rancher/k3s/agent/images/
COPY k3s-airgap-images-amd64.tar /var/lib/rancher/k3s/agent/images/
COPY k3s /usr/local/bin/
RUN sudo chmod a+x /usr/local/bin/k3s
RUN curl -L https://get.k3s.io -o /root/install-k3s.sh; chmod a+x /root/install-k3s.sh;
RUN mkdir -p /opt/cni/bin/; chmod 755 /opt/cni/bin; mkdir -p /etc/cni/net.d/; chmod 755 /etc/cni/net.d/
ADD cni-plugins-linux-amd64-v0.8.5.tgz /opt/cni/bin/
COPY calico-amd64 /opt/cni/bin/calico
COPY calico-ipam-amd64 /opt/cni/bin/calico-ipam
RUN chmod a+x /opt/cni/bin/*
COPY 10-calico.conflist /etc/cni/net.d/10-calico.conflist
COPY calico-node.service /etc/systemd/system/calico-node.service
# may only need these instead of all the other Calico stuff
COPY tigera-operator.yaml /root/tigera-operator.yaml
COPY custom-resources.yaml /root/custom-resources.yaml
COPY calico.yaml /root/calico.yaml
COPY calico-k3s.yaml /root/calico-k3s.yaml
# TODO don't use a local folder for this -- probably just pull in binary
COPY packet-trace /usr/local/bin/packet-trace
RUN chmod a+x /usr/local/bin/packet-trace
COPY stern_linux_amd64 /usr/local/bin/stern
RUN chmod a+x /usr/local/bin/stern
# make it so other tools can use the kubernetes API
RUN echo 'set -x KUBECONFIG /etc/rancher/k3s/k3s.yaml'>> /etc/fish/conf.d/kubeconfig.fish
RUN cp /usr/share/fish/vendor_functions.d/fzf_key_bindings.fish /etc/fish/conf.d/; echo "fzf_key_bindings" >> /etc/fish/conf.d/init_fzf_key_bindings.fish
COPY sock-shop-complete.yaml /root/sock-shop-complete.yaml
COPY hello-kubernetes.yaml /root/hello-kubernetes.yaml
Thank you very much for the tutorial. I am interested how the docker image was built.