Azure-storage-azcopy: azcopy: command not found

Created on 30 Sep 2019  路  10Comments  路  Source: Azure/azure-storage-azcopy

Which version of the AzCopy was used?

https://azcopyvnext.azureedge.net/release20190703/azcopy_linux_amd64_10.2.1.tar.gz

Which platform are you using? (ex: Windows, Mac, Linux)

"alpine" container

What command did you run?

So I downloaded this with:
curl -L -JO https://azcopyvnext.azureedge.net/release20190703/azcopy_linux_amd64_10.2.1.tar.gz

Then extracted

tar -xf azcopy_linux_amd64_10.2.1.tar.gz

I get a file called "azcopy"...

-rwxr-xr-x 1 501 staff 18914367 Jul  4 00:10 azcopy

that I cannot run
bash: azcopy: command not found

I'm not really a linux user but it seems to already be set to allow execution. Something else needed?

Most helpful comment

@worldspawn I ran into the same issue.
In short, to resolve it I ran apk add libc6-compat.
Let me know if that works for you as well.

--

The linux_amd64 build of azcopy requires some shared libraries that aren't pre-installed on alpine.

ldd azcopy will list these shared libraries:

# ldd azcopy
        /lib64/ld-linux-x86-64.so.2 (0x7f94150c9000)
        libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7f94150c9000)
        libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f94150c9000)

A search of ld-linux-x86-64.so.2 on https://pkgs.alpinelinux.org/ reveals it can be found in libc6-compat.

Then, running azcopy works as expected on alpine.

All 10 comments

Try running it by calling it

./azcopy

Instead of just azcopy.

And make sure your working directory, at the time, is the place where the azcopy executable is.

If that doesn't work, please let us know and we'll see what else we can do to help.

Hi @worldspawn, the OS can only find azcopy if it was part of the path. Invoking it with a relative path ./azcopy or absolute path /usr/name/bla/azcopy would be the alternatively way.

From the top...

kubectl.exe run -it alpine --image=alpine

now i'm in the container...

apk update
apk add curl
curl -L -JO https://azcopyvnext.azureedge.net/release20190703/azcopy_linux_amd64_10.2.1.tar.gz
tar -xf azcopy_linux_amd64_10.2.1.tar.gz
cd azcopy_linux_amd64_10.2.1/

I am now in /azcopy_linux_amd64_10.2.1. ls -l output is:

/azcopy_linux_amd64_10.2.1 # ls -l
total 18488
-rw-r--r--    1 501      dialout      16068 Jul  4 00:10 ThirdPartyNotice.txt
-rwxr-xr-x    1 501      dialout   18914367 Jul  4 00:10 azcopy

Now I...

/azcopy_linux_amd64_10.2.1 # ./azcopy
/bin/sh: ./azcopy: not found

@zezha-msft @JohnRusk azcopy is definately in my cwd.

Repro!

Dockerfile

# => Run container
FROM alpine

RUN apk update
RUN apk add curl
RUN curl -L -JO https://azcopyvnext.azureedge.net/release20190703/azcopy_linux_amd64_10.2.1.tar.gz
RUN tar -xf azcopy_linux_amd64_10.2.1.tar.gz

WORKDIR /azcopy_linux_amd64_10.2.1

docker build -t azcopy .
docker run -it azcopy /bin/ash

Sorry @worldspawn, we cannot debug your environment unfortunately.

@worldspawn I ran into the same issue.
In short, to resolve it I ran apk add libc6-compat.
Let me know if that works for you as well.

--

The linux_amd64 build of azcopy requires some shared libraries that aren't pre-installed on alpine.

ldd azcopy will list these shared libraries:

# ldd azcopy
        /lib64/ld-linux-x86-64.so.2 (0x7f94150c9000)
        libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7f94150c9000)
        libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f94150c9000)

A search of ld-linux-x86-64.so.2 on https://pkgs.alpinelinux.org/ reveals it can be found in libc6-compat.

Then, running azcopy works as expected on alpine.

@zezha-msft If the above works for others, it would be nice to see it added to the doc.
I've filed https://github.com/MicrosoftDocs/azure-docs/issues/40155 for this.

Ah thanks @derekbekoe. i ended up just changing my base to ubuntu. I'll try it on Monday.

@derekbekoe confirmed this made it work. 馃憤 馃

Working (improved) Dockerfile

# => Run container
FROM alpine

# Add bash
RUN apk update
RUN apk add libc6-compat
RUN apk add curl
RUN mkdir /azcopy 
WORKDIR /azcopy
RUN curl -L -J https://aka.ms/downloadazcopy-v10-linux -o ./azcopyarchive.tar.gz
RUN tar -xf ./azcopyarchive.tar.gz --strip-components=1

Would love to see an image maintained by the azcopy team.

Thanks a lot @derekbekoe for posting the solution here! And thanks @worldspawn for confirming it solved your problem.

Hi @normesta, could you please add this information into our docs? Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DavidLafond picture DavidLafond  路  5Comments

ldepaiva picture ldepaiva  路  3Comments

LoofahBu picture LoofahBu  路  3Comments

massive picture massive  路  3Comments

alvipeo picture alvipeo  路  4Comments