Skip to content

Commit

Permalink
ARM64 binary build (#1988)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramanan-ravi authored Feb 22, 2024
1 parent 655681b commit 2aa1839
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ publish-jaeger:
.PHONY: clean
clean:
-(cd $(DEEPFENCE_AGENT_DIR) && make clean)
-(cd $(DEEPFENCE_FARGATE_DIR) && rm -rf deepfence-agent-bin-$(VERSION)*)
-(cd $(ROOT_MAKEFILE_DIR)/deepfence_server && make clean)
-(cd $(ROOT_MAKEFILE_DIR)/deepfence_worker && make clean)
-(cd $(DEEPFENCED) && make clean && rm $(DEEPFENCE_AGENT_DIR)/deepfenced)
Binary file added deepfence_agent/fargate/bin-arm64/bash
Binary file not shown.
Binary file added deepfence_agent/fargate/bin-arm64/busybox
Binary file not shown.
36 changes: 33 additions & 3 deletions deepfence_agent/fargate/copy-bin-from-agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,38 @@ rm -rf $folder
# create folder
mkdir -p $folder

copy_bin_amd64() {
cp -R bin $folder/
}

copy_bin_arm64() {
cp -R bin-arm64 $folder/
cp $folder/busybox $folder/cat
cp $folder/busybox $folder/chmod
cp $folder/busybox $folder/cp
cp $folder/busybox $folder/gzip
cp $folder/busybox $folder/hostname
cp $folder/busybox $folder/kill
cp $folder/busybox $folder/ln
cp $folder/busybox $folder/ls
cp $folder/busybox $folder/mkdir
cp $folder/busybox $folder/nice
cp $folder/busybox $folder/rm
cp $folder/busybox $folder/sed
cp $folder/busybox $folder/sleep
cp $folder/busybox $folder/tar
}

copy() {
echo "Copying ..."
cp -R bin $folder/

architecture=$(uname -m)
if [[ $architecture == "aarch64" || $architecture == "arm" ]]; then
copy_bin_arm64
else
copy_bin_amd64
fi

deep_docker_copy "/bin/deepfenced" "$folder/bin/."
deep_docker_copy "/home/." "$folder/home/."
deep_docker_copy "/opt/." "$folder/opt/."
Expand All @@ -50,9 +79,10 @@ copy

echo "Creating tar.gz file..."
rm -rf $folder.tar.gz
sudo chown -R root:root $folder
cd $folder
tar -czvf $folder.tar.gz .
mv $folder.tar.gz ../
sudo tar -czvf $folder.tar.gz .
sudo mv $folder.tar.gz ../

cd ../
# rm -rf $folder
Expand Down

0 comments on commit 2aa1839

Please sign in to comment.