Skip to content

Tar command failing on ARM64 nodes. #18

@mattmattox

Description

@mattmattox

When building the image on ARM64 nodes. You'll get the following error message. It looks like the option --include is not part of the tar command in this version.

Step 13/19 : RUN set -ex;     if [ "$(go env GOARCH)" = "arm64" ]; then         wget -q "https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-ARM64.tar.gz";         tar -xzf trivy_${TRIVY_VERSION}_Linux-ARM64.tar.gz --include trivy -C /usr/local/bin;         mv trivy /usr/local/bin;                                 else                                                             wget -q "https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz";         tar -xzf trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz;          mv trivy /usr/local/bin;                                 fi
 ---> Running in c1dbe26642a4
+ go env GOARCH
+ '[' arm64 '=' arm64 ]
+ wget -q https://github.com/aquasecurity/trivy/releases/download/v0.18.3/trivy_0.18.3_Linux-ARM64.tar.gz
+ tar -xzf trivy_0.18.3_Linux-ARM64.tar.gz --include trivy -C /usr/local/bin
tar: unrecognized option: include
BusyBox v1.34.1 (2022-04-04 10:19:27 UTC) multi-call binary.

Usage: tar c|x|t [-ZzJjahmvokO] [-f TARFILE] [-C DIR] [-T FILE] [-X FILE] [LONGOPT]... [FILE]...

Create, extract, or list files from a tar file

	c	Create
	x	Extract
	t	List
	-f FILE	Name of TARFILE ('-' for stdin/out)
	-C DIR	Change to DIR before operation
	-v	Verbose
	-O	Extract to stdout
	-m	Don't restore mtime
	-o	Don't restore user:group
	-k	Don't replace existing files
	-Z	(De)compress using compress
	-z	(De)compress using gzip
	-J	(De)compress using xz
	-j	(De)compress using bzip2
	--lzma	(De)compress using lzma
	-a	(De)compress based on extension
	-h	Follow symlinks
	-T FILE	File with names to include
	-X FILE	File with glob patterns to exclude
	--exclude PATTERN	Glob pattern to exclude
	--overwrite		Replace existing files
	--strip-components NUM	NUM of leading components to strip
	--no-recursion		Don't descend in directories
	--numeric-owner		Use numeric user:group
	--no-same-permissions	Don't restore access permissions
The command '/bin/sh -c set -ex;     if [ "$(go env GOARCH)" = "arm64" ]; then         wget -q "https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-ARM64.tar.gz";         tar -xzf trivy_${TRIVY_VERSION}_Linux-ARM64.tar.gz --include trivy -C /usr/local/bin;         mv trivy /usr/local/bin;                                 else                                                             wget -q "https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz";         tar -xzf trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz;          mv trivy /usr/local/bin;                                 fi' returned a non-zero code: 1
make: *** [Makefile:16: image-build] Error 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions