Skip to content

Commit

Permalink
feat: add retina-shell image for Linux
Browse files Browse the repository at this point in the history
Signed-off-by: Will Daly <[email protected]>
  • Loading branch information
wedaly committed Nov 4, 2024
1 parent ecdabdb commit c45574f
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ RETINA_TOOLS_IMAGE = $(IMAGE_NAMESPACE)/retina-tools
RETINA_IMAGE = $(IMAGE_NAMESPACE)/retina-agent
RETINA_INIT_IMAGE = $(IMAGE_NAMESPACE)/retina-init
RETINA_OPERATOR_IMAGE = $(IMAGE_NAMESPACE)/retina-operator
RETINA_SHELL_IMAGE = $(IMAGE_NAMESPACE)/retina-shell
RETINA_INTEGRATION_TEST_IMAGE = $(IMAGE_NAMESPACE)/retina-integration-test
RETINA_PROTO_IMAGE = $(IMAGE_NAMESPACE)/retina-proto-gen
RETINA_GO_GEN_IMAGE = $(IMAGE_NAMESPACE)/retina-go-gen
Expand Down Expand Up @@ -307,6 +308,18 @@ retina-operator-image: ## build the retina linux operator image.
APP_INSIGHTS_ID=$(APP_INSIGHTS_ID) \
CONTEXT_DIR=$(REPO_ROOT)

retina-shell-image:
echo "Building for $(PLATFORM)"
set -e ; \
$(MAKE) container-$(CONTAINER_BUILDER) \
PLATFORM=$(PLATFORM) \
DOCKERFILE=shell/Dockerfile \
REGISTRY=$(IMAGE_REGISTRY) \
IMAGE=$(RETINA_SHELL_IMAGE) \
VERSION=$(TAG) \
TAG=$(RETINA_PLATFORM_TAG) \
CONTEXT_DIR=$(REPO_ROOT)

kapinger-image:
docker buildx build --builder retina --platform windows/amd64 --target windows-amd64 -t $(IMAGE_REGISTRY)/$(KAPINGER_IMAGE):$(TAG)-windows-amd64 ./hack/tools/kapinger/ --push
docker buildx build --builder retina --platform linux/amd64 --target linux-amd64 -t $(IMAGE_REGISTRY)/$(KAPINGER_IMAGE):$(TAG)-linux-amd64 ./hack/tools/kapinger/ --push
Expand Down Expand Up @@ -347,12 +360,18 @@ manifest-operator-image: ## create a multiplatform manifest for the operator ima
$(eval FULL_IMAGE_NAME=$(IMAGE_REGISTRY)/$(RETINA_OPERATOR_IMAGE):$(TAG))
docker buildx imagetools create -t $(FULL_IMAGE_NAME) $(foreach platform,linux/amd64, $(FULL_IMAGE_NAME)-$(subst /,-,$(platform)))

manifest-shell-image:
$(eval FULL_IMAGE_NAME=$(IMAGE_REGISTRY)/$(RETINA_SHELL_IMAGE):$(TAG))
docker buildx imagetools create -t $(FULL_IMAGE_NAME) $(foreach platform,linux/amd64 linux/arm64, $(FULL_IMAGE_NAME)-$(subst /,-,$(platform)))

manifest:
echo "Building for $(COMPONENT)"
if [ "$(COMPONENT)" = "retina" ]; then \
$(MAKE) manifest-retina-image; \
elif [ "$(COMPONENT)" = "operator" ]; then \
$(MAKE) manifest-operator-image; \
elif [ "$(COMPONENT)" = "shell" ]; then \
$(MAKE) manifest-shell-image; \
fi

##@ Tests
Expand Down
31 changes: 31 additions & 0 deletions shell/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# mcr.microsoft.com/azurelinux/base/core:3.0.20241005
FROM mcr.microsoft.com/azurelinux/base/core@sha256:7ec490b605aac8a44aed0b0695b0ee6ae976ec898afd9ac8d5613d7f3ce2b07b

# There are a two known issues with Azure Linux 3.0.20241005 that affect this image:
# 1. `iptables-nft` binary is not yet installed, but will be fixed by https://github.com/microsoft/azurelinux/pull/10786
# Until then, use `nft` to view nftables rules.
# 2. `nslookup` and `bind` print an error "Algorithm not supported by SCOSSL" (but still complete successfully).
# This will be fixed by https://github.com/microsoft/SymCrypt-OpenSSL/pull/92
RUN tdnf install -y \
bind-utils \
bpftool \
bpftrace \
conntrack \
curl \
ebtables-legacy \
iperf3 \
iproute \
ipset \
iptables \
iputils \
ldns-utils \
net-tools \
nftables \
nmap \
openssh \
socat \
tcpdump \
wget \
&& tdnf clean all

CMD ["/bin/bash"]

0 comments on commit c45574f

Please sign in to comment.