Pipelines cannot run 32-bit executable
Asked by tohellwithtinytim:

During pipeline execution I'm unable to run a 32-bit executable inside of docker. I have taken the default build image (atlassian/default-image) and added the required 32-bit libraries to run the 32-bit executable but it still does not work. However, outside of bitbucket pipelines this works fine.

I believe my issue is the same as this:

[https://community.atlassian.com/t5/Bitbucket-questions/Unable-to-run-32-bit-executable-on-Ubuntu-20-04-on-Pipelines/qaq-p/1915430](https://community.atlassian.com/t5/Bitbucket-questions/Unable-to-run-32-bit-executable-on-Ubuntu-16-04-on-Pipelines/qaq-p/1688253)

Per Zeex suggestion from the above thread, I'm reaching out to support to in regards to enabling 32-bit support for my pipeline.


Answers:
author: tohellwithtinytim
body: Hey [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086), thank you for reaching out.

See below.

The build fails when it attempts to run the 32-bit executable (amxxpc) during the Dockerfile build.

However, this all works fine when I use a self-hosted runner on Ubuntu 20.04.

<br />

bitbucket-pipelines.yml  
-----------------------

image: seaoddit/atlassian-builder-image-ia32

pipelines:  
branches:  
dev:  
- step:  
script:  
- git submodule update --init --recursive  
- apt-get update \&\& apt-get --yes --force-yes install lib32z1 lib32ncurses5 lib32bz2-1.0  
- docker login -u $DOCKER_HUB_ID -p $DOCKER_HUB_PASSWORD  
- docker build --platform="linux/amd64" -t $DOCKER_HUB_ID/$DOCKER_REPO:latest .  
- docker push $DOCKER_HUB_ID/$DOCKER_REPO:latest  
options:  
docker: true

<br />

Dockerfile being built  
-----------------------

FROM seaoddit/tfc-batcave:amxmodx-tfc-1-9-0-5271

# Orpheu 2.6.3

COPY "orpheu-files-2.6.3/" "/home/steam/tfc-server/tfc/addons/amxmodx/"

# ServerDatabase

COPY "serverdatabase-fork/" "/home/steam/amxmodx-plugins/ServerDatabase"  
RUN cp "/home/steam/amxmodx-plugins/ServerDatabase/ServerDatabase.sma" "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/"  
RUN cp "/home/steam/amxmodx-plugins/ServerDatabase/hlstriker_server_db.inc" "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/include/"  
WORKDIR "/home/steam/tfc-server/tfc/addons/amxmodx/scripting"  
#RUN \["/home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc", "ServerDatabase.sma"\]  
RUN "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc" "ServerDatabase.sma"  
RUN mv "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/ServerDatabase.amxx" "/home/steam/tfc-server/tfc/addons/amxmodx/plugins/"  
RUN echo "ServerDatabase.amxx" \>\> "/home/steam/tfc-server/tfc/addons/amxmodx/configs/plugins.ini"

Pipelines Build Return  
-----------------------

docker build --platform="linux/amd64" -t $DOCKER_HUB_ID/$DOCKER_REPO:latest .23s

+ docker build --platform="linux/amd64" -t $DOCKER_HUB_ID/$DOCKER_REPO:latest .

Sending build context to Docker daemon 2.039MB

Step 1/49 : FROM $DOCKER_HUB_ID/$DOCKER_REPO:amxmodx-tfc-1-9-0-5271

amxmodx-tfc-1-9-0-5271: Pulling from $DOCKER_HUB_ID/$DOCKER_REPO

8740c948ffd4: Pulling fs layer

4b977f43e269: Pulling fs layer

44fb41d970a3: Pulling fs layer

1efc1fdb38f7: Pulling fs layer

41498acf7408: Pulling fs layer

663c64010fc2: Pulling fs layer

6123eca03eff: Pulling fs layer

7a283e294632: Pulling fs layer

663c64010fc2: Waiting

6123eca03eff: Waiting

1efc1fdb38f7: Waiting

41498acf7408: Waiting

7a283e294632: Waiting

9647196b2478: Pulling fs layer

9647196b2478: Waiting

bdfaf9dd363f: Pulling fs layer

834bb0ee027a: Pulling fs layer

bdfaf9dd363f: Waiting

44fb41d970a3: Verifying Checksum

44fb41d970a3: Download complete

8740c948ffd4: Verifying Checksum

8740c948ffd4: Download complete

1efc1fdb38f7: Verifying Checksum

1efc1fdb38f7: Download complete

41498acf7408: Verifying Checksum

41498acf7408: Download complete

8740c948ffd4: Pull complete

6123eca03eff: Verifying Checksum

6123eca03eff: Download complete

7a283e294632: Download complete

9647196b2478: Verifying Checksum

9647196b2478: Download complete

4b977f43e269: Download complete

834bb0ee027a: Verifying Checksum

834bb0ee027a: Download complete

bdfaf9dd363f: Verifying Checksum

bdfaf9dd363f: Download complete

4b977f43e269: Pull complete

44fb41d970a3: Pull complete

1efc1fdb38f7: Pull complete

41498acf7408: Pull complete

663c64010fc2: Download complete

663c64010fc2: Pull complete

6123eca03eff: Pull complete

7a283e294632: Pull complete

9647196b2478: Pull complete

bdfaf9dd363f: Pull complete

834bb0ee027a: Pull complete

Digest: sha256:451d6be1807060e3e026afcaf7efaf56eb294cbb8c11ddaa7158cb19d0994687

Status: Downloaded newer image for $DOCKER_HUB_ID/$DOCKER_REPO:amxmodx-tfc-1-9-0-5271

---\> 1834dce756e8

Step 2/49 : COPY "orpheu-files-2.6.3/" "/home/steam/tfc-server/tfc/addons/amxmodx/"

---\> aa2296d28bba

Step 3/49 : COPY "serverdatabase-fork/" "/home/steam/amxmodx-plugins/ServerDatabase"

---\> 031b343b9086

Step 4/49 : RUN cp "/home/steam/amxmodx-plugins/ServerDatabase/ServerDatabase.sma" "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/"

---\> Running in 24d3f96e2279

Removing intermediate container 24d3f96e2279

---\> d0ec38b2983a

Step 5/49 : RUN cp "/home/steam/amxmodx-plugins/ServerDatabase/hlstriker_server_db.inc" "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/include/"

---\> Running in 8fe5e47d73d9

Removing intermediate container 8fe5e47d73d9

---\> 5bb1abdff852

Step 6/49 : WORKDIR "/home/steam/tfc-server/tfc/addons/amxmodx/scripting"

---\> Running in 74278fdec036

Removing intermediate container 74278fdec036

---\> 64b5534a5dfa

Step 7/49 : RUN "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc" "ServerDatabase.sma"

---\> Running in 9d4a0919a30a

/bin/sh: 1: /home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc: Exec format error

The command '/bin/sh -c "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc" "ServerDatabase.sma"' returned a non-zero code: 126

2023-12-07T21:46:33.272799398Z stdout P


author: Theodora Boudale
body: Hi [@tohellwithtinytim](/t5/user/viewprofilepage/user-id/5377885) and welcome to the community!

Could you please let me know the following:

1. Does this Pipelines build run on Atlassian's infrastructure or are you using one of our self-hosted [runners](https://support.atlassian.com/bitbucket-cloud/docs/runners/)?  

2. You mentioned that outside of Pipelines the build works fine. If the build runs on Atlassian's infrastructure, these builds run in Docker containers. Are you able to reproduce the error if you debug the build locally with Docker as per the following guide? Or does the build succeed in this case?  

   <https://confluence.atlassian.com/bbkb/troubleshoot-failed-bitbucket-pipelines-locally-with-docker-1318882094.html>  

3. Do you have a sample yml file you can share that reproduces this issue?

Kind regards,  
Theodora

comments: author: tohellwithtinytim
body: See below.

The build fails when trying to run the 32-bit executable 'amxxpc'.

However, when I use a self-hosted runner on my Ubuntu 20.04 these work fine.

bitbucket-pipelines.yml
----------------------- {#toc-hId--409704366}
-----------------------------------------------------------------------

```
image: seaoddit/atlassian-builder-image-ia32

pipelines:
branches:
dev:
- step:
script:
- git submodule update --init --recursive
- apt-get update && apt-get --yes --force-yes install lib32z1 lib32ncurses5 lib32bz2-1.0
- docker login -u $DOCKER_HUB_ID -p $DOCKER_HUB_PASSWORD
- docker build --platform="linux/amd64" -t $DOCKER_HUB_ID/$DOCKER_REPO:latest .
- docker push $DOCKER_HUB_ID/$DOCKER_REPO:latest
options:
docker: true
```

Dockerfile being built
----------------------- {#toc-hId-2077808467}
----------------------------------------------------------------------

```
FROM seaoddit/tfc-batcave:amxmodx-tfc-1-9-0-5271

# Orpheu 2.6.3

COPY "orpheu-files-2.6.3/" "/home/steam/tfc-server/tfc/addons/amxmodx/"

# ServerDatabase

COPY "serverdatabase-fork/" "/home/steam/amxmodx-plugins/ServerDatabase"
RUN cp "/home/steam/amxmodx-plugins/ServerDatabase/ServerDatabase.sma" "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/"
RUN cp "/home/steam/amxmodx-plugins/ServerDatabase/hlstriker_server_db.inc" "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/include/"
WORKDIR "/home/steam/tfc-server/tfc/addons/amxmodx/scripting"
#RUN ["/home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc", "ServerDatabase.sma"]
RUN "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc" "ServerDatabase.sma"
RUN mv "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/ServerDatabase.amxx" "/home/steam/tfc-server/tfc/addons/amxmodx/plugins/"
RUN echo "ServerDatabase.amxx" >> "/home/steam/tfc-server/tfc/addons/amxmodx/configs/plugins.ini"
```

Pipelines Build Return
----------------------- {#toc-hId-270354004}
---------------------------------------------------------------------

```
docker build --platform="linux/amd64" -t $DOCKER_HUB_ID/$DOCKER_REPO:latest .23s

+ docker build --platform="linux/amd64" -t $DOCKER_HUB_ID/$DOCKER_REPO:latest .

Sending build context to Docker daemon 2.039MB

Step 1/49 : FROM $DOCKER_HUB_ID/$DOCKER_REPO:amxmodx-tfc-1-9-0-5271

amxmodx-tfc-1-9-0-5271: Pulling from $DOCKER_HUB_ID/$DOCKER_REPO

8740c948ffd4: Pulling fs layer

4b977f43e269: Pulling fs layer

44fb41d970a3: Pulling fs layer

1efc1fdb38f7: Pulling fs layer

41498acf7408: Pulling fs layer

663c64010fc2: Pulling fs layer

6123eca03eff: Pulling fs layer

7a283e294632: Pulling fs layer

663c64010fc2: Waiting

6123eca03eff: Waiting

1efc1fdb38f7: Waiting

41498acf7408: Waiting

7a283e294632: Waiting

9647196b2478: Pulling fs layer

9647196b2478: Waiting

bdfaf9dd363f: Pulling fs layer

834bb0ee027a: Pulling fs layer

bdfaf9dd363f: Waiting

44fb41d970a3: Verifying Checksum

44fb41d970a3: Download complete

8740c948ffd4: Verifying Checksum

8740c948ffd4: Download complete

1efc1fdb38f7: Verifying Checksum

1efc1fdb38f7: Download complete

41498acf7408: Verifying Checksum

41498acf7408: Download complete

8740c948ffd4: Pull complete

6123eca03eff: Verifying Checksum

6123eca03eff: Download complete

7a283e294632: Download complete

9647196b2478: Verifying Checksum

9647196b2478: Download complete

4b977f43e269: Download complete

834bb0ee027a: Verifying Checksum

834bb0ee027a: Download complete

bdfaf9dd363f: Verifying Checksum

bdfaf9dd363f: Download complete

4b977f43e269: Pull complete

44fb41d970a3: Pull complete

1efc1fdb38f7: Pull complete

41498acf7408: Pull complete

663c64010fc2: Download complete

663c64010fc2: Pull complete

6123eca03eff: Pull complete

7a283e294632: Pull complete

9647196b2478: Pull complete

bdfaf9dd363f: Pull complete

834bb0ee027a: Pull complete

Digest: sha256:451d6be1807060e3e026afcaf7efaf56eb294cbb8c11ddaa7158cb19d0994687

Status: Downloaded newer image for $DOCKER_HUB_ID/$DOCKER_REPO:amxmodx-tfc-1-9-0-5271

---> 1834dce756e8

Step 2/49 : COPY "orpheu-files-2.6.3/" "/home/steam/tfc-server/tfc/addons/amxmodx/"

---> aa2296d28bba

Step 3/49 : COPY "serverdatabase-fork/" "/home/steam/amxmodx-plugins/ServerDatabase"

---> 031b343b9086

Step 4/49 : RUN cp "/home/steam/amxmodx-plugins/ServerDatabase/ServerDatabase.sma" "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/"

---> Running in 24d3f96e2279

Removing intermediate container 24d3f96e2279

---> d0ec38b2983a

Step 5/49 : RUN cp "/home/steam/amxmodx-plugins/ServerDatabase/hlstriker_server_db.inc" "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/include/"

---> Running in 8fe5e47d73d9

Removing intermediate container 8fe5e47d73d9

---> 5bb1abdff852

Step 6/49 : WORKDIR "/home/steam/tfc-server/tfc/addons/amxmodx/scripting"

---> Running in 74278fdec036

Removing intermediate container 74278fdec036

---> 64b5534a5dfa

Step 7/49 : RUN "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc" "ServerDatabase.sma"

---> Running in 9d4a0919a30a

/bin/sh: 1: /home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc: Exec format error

The command '/bin/sh -c "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc" "ServerDatabase.sma"' returned a non-zero code: 126

2023-12-07T21:46:33.272799398Z stdout P
```


author: tohellwithtinytim
body: Hey [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) , thank you for reaching out.

See below.

The build fails when it attempts to run the 32-bit executable (amxxpc) during the Dockerfile build.

However, this all works fine when I use a self-hosted runner on Ubuntu 20.04.

bitbucket-pipelines.yml  
-----------------------

```
image: seaoddit/atlassian-builder-image-ia32

pipelines:
branches:
dev:
- step:
script:
- git submodule update --init --recursive
- apt-get update && apt-get --yes --force-yes install lib32z1 lib32ncurses5 lib32bz2-1.0
- docker login -u $DOCKER_HUB_ID -p $DOCKER_HUB_PASSWORD
- docker build --platform="linux/amd64" -t $DOCKER_HUB_ID/$DOCKER_REPO:latest .
- docker push $DOCKER_HUB_ID/$DOCKER_REPO:latest
options:
docker: true
```

<br />

Dockerfile being built  
-----------------------

```
FROM seaoddit/tfc-batcave:amxmodx-tfc-1-9-0-5271

# Orpheu 2.6.3

COPY "orpheu-files-2.6.3/" "/home/steam/tfc-server/tfc/addons/amxmodx/"

# ServerDatabase

COPY "serverdatabase-fork/" "/home/steam/amxmodx-plugins/ServerDatabase"
RUN cp "/home/steam/amxmodx-plugins/ServerDatabase/ServerDatabase.sma" "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/"
RUN cp "/home/steam/amxmodx-plugins/ServerDatabase/hlstriker_server_db.inc" "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/include/"
WORKDIR "/home/steam/tfc-server/tfc/addons/amxmodx/scripting"
#RUN ["/home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc", "ServerDatabase.sma"]
RUN "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc" "ServerDatabase.sma"
RUN mv "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/ServerDatabase.amxx" "/home/steam/tfc-server/tfc/addons/amxmodx/plugins/"
RUN echo "ServerDatabase.amxx" >> "/home/steam/tfc-server/tfc/addons/amxmodx/configs/plugins.ini"
```

Pipelines Build Return  
-----------------------

```
docker build --platform="linux/amd64" -t $DOCKER_HUB_ID/$DOCKER_REPO:latest .23s

+ docker build --platform="linux/amd64" -t $DOCKER_HUB_ID/$DOCKER_REPO:latest .

Sending build context to Docker daemon 2.039MB

Step 1/49 : FROM $DOCKER_HUB_ID/$DOCKER_REPO:amxmodx-tfc-1-9-0-5271

amxmodx-tfc-1-9-0-5271: Pulling from $DOCKER_HUB_ID/$DOCKER_REPO

8740c948ffd4: Pulling fs layer

4b977f43e269: Pulling fs layer

44fb41d970a3: Pulling fs layer

1efc1fdb38f7: Pulling fs layer

41498acf7408: Pulling fs layer

663c64010fc2: Pulling fs layer

6123eca03eff: Pulling fs layer

7a283e294632: Pulling fs layer

663c64010fc2: Waiting

6123eca03eff: Waiting

1efc1fdb38f7: Waiting

41498acf7408: Waiting

7a283e294632: Waiting

9647196b2478: Pulling fs layer

9647196b2478: Waiting

bdfaf9dd363f: Pulling fs layer

834bb0ee027a: Pulling fs layer

bdfaf9dd363f: Waiting

44fb41d970a3: Verifying Checksum

44fb41d970a3: Download complete

8740c948ffd4: Verifying Checksum

8740c948ffd4: Download complete

1efc1fdb38f7: Verifying Checksum

1efc1fdb38f7: Download complete

41498acf7408: Verifying Checksum

41498acf7408: Download complete

8740c948ffd4: Pull complete

6123eca03eff: Verifying Checksum

6123eca03eff: Download complete

7a283e294632: Download complete

9647196b2478: Verifying Checksum

9647196b2478: Download complete

4b977f43e269: Download complete

834bb0ee027a: Verifying Checksum

834bb0ee027a: Download complete

bdfaf9dd363f: Verifying Checksum

bdfaf9dd363f: Download complete

4b977f43e269: Pull complete

44fb41d970a3: Pull complete

1efc1fdb38f7: Pull complete

41498acf7408: Pull complete

663c64010fc2: Download complete

663c64010fc2: Pull complete

6123eca03eff: Pull complete

7a283e294632: Pull complete

9647196b2478: Pull complete

bdfaf9dd363f: Pull complete

834bb0ee027a: Pull complete

Digest: sha256:451d6be1807060e3e026afcaf7efaf56eb294cbb8c11ddaa7158cb19d0994687

Status: Downloaded newer image for $DOCKER_HUB_ID/$DOCKER_REPO:amxmodx-tfc-1-9-0-5271

---> 1834dce756e8

Step 2/49 : COPY "orpheu-files-2.6.3/" "/home/steam/tfc-server/tfc/addons/amxmodx/"

---> aa2296d28bba

Step 3/49 : COPY "serverdatabase-fork/" "/home/steam/amxmodx-plugins/ServerDatabase"

---> 031b343b9086

Step 4/49 : RUN cp "/home/steam/amxmodx-plugins/ServerDatabase/ServerDatabase.sma" "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/"

---> Running in 24d3f96e2279

Removing intermediate container 24d3f96e2279

---> d0ec38b2983a

Step 5/49 : RUN cp "/home/steam/amxmodx-plugins/ServerDatabase/hlstriker_server_db.inc" "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/include/"

---> Running in 8fe5e47d73d9

Removing intermediate container 8fe5e47d73d9

---> 5bb1abdff852

Step 6/49 : WORKDIR "/home/steam/tfc-server/tfc/addons/amxmodx/scripting"

---> Running in 74278fdec036

Removing intermediate container 74278fdec036

---> 64b5534a5dfa

Step 7/49 : RUN "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc" "ServerDatabase.sma"

---> Running in 9d4a0919a30a

/bin/sh: 1: /home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc: Exec format error

The command '/bin/sh -c "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc" "ServerDatabase.sma"' returned a non-zero code: 126

2023-12-07T21:46:33.272799398Z stdout P
```


author: tohellwithtinytim
body: Hey [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) , thank you for reaching out.

See below.

The build fails when it attempts to run the 32-bit executable (amxxpc) during the Dockerfile build.

However, this all works fine when I use a self-hosted runner on Ubuntu 20.04.

<br />

bitbucket-pipelines.yml  
-----------------------

image: seaoddit/atlassian-builder-image-ia32

pipelines:  
branches:  
dev:  
- step:  
script:  
- git submodule update --init --recursive  
- apt-get update \&\& apt-get --yes --force-yes install lib32z1 lib32ncurses5 lib32bz2-1.0  
- docker login -u $DOCKER_HUB_ID -p $DOCKER_HUB_PASSWORD  
- docker build --platform="linux/amd64" -t $DOCKER_HUB_ID/$DOCKER_REPO:latest .  
- docker push $DOCKER_HUB_ID/$DOCKER_REPO:latest  
options:  
docker: true

<br />

Dockerfile being built  
-----------------------

FROM seaoddit/tfc-batcave:amxmodx-tfc-1-9-0-5271

# Orpheu 2.6.3

COPY "orpheu-files-2.6.3/" "/home/steam/tfc-server/tfc/addons/amxmodx/"

# ServerDatabase

COPY "serverdatabase-fork/" "/home/steam/amxmodx-plugins/ServerDatabase"  
RUN cp "/home/steam/amxmodx-plugins/ServerDatabase/ServerDatabase.sma" "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/"  
RUN cp "/home/steam/amxmodx-plugins/ServerDatabase/hlstriker_server_db.inc" "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/include/"  
WORKDIR "/home/steam/tfc-server/tfc/addons/amxmodx/scripting"  
#RUN \["/home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc", "ServerDatabase.sma"\]  
RUN "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc" "ServerDatabase.sma"  
RUN mv "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/ServerDatabase.amxx" "/home/steam/tfc-server/tfc/addons/amxmodx/plugins/"  
RUN echo "ServerDatabase.amxx" \>\> "/home/steam/tfc-server/tfc/addons/amxmodx/configs/plugins.ini"

Pipelines Build Return  
-----------------------

docker build --platform="linux/amd64" -t $DOCKER_HUB_ID/$DOCKER_REPO:latest .23s

+ docker build --platform="linux/amd64" -t $DOCKER_HUB_ID/$DOCKER_REPO:latest .

Sending build context to Docker daemon 2.039MB

Step 1/49 : FROM $DOCKER_HUB_ID/$DOCKER_REPO:amxmodx-tfc-1-9-0-5271

amxmodx-tfc-1-9-0-5271: Pulling from $DOCKER_HUB_ID/$DOCKER_REPO

8740c948ffd4: Pulling fs layer

4b977f43e269: Pulling fs layer

44fb41d970a3: Pulling fs layer

1efc1fdb38f7: Pulling fs layer

41498acf7408: Pulling fs layer

663c64010fc2: Pulling fs layer

6123eca03eff: Pulling fs layer

7a283e294632: Pulling fs layer

663c64010fc2: Waiting

6123eca03eff: Waiting

1efc1fdb38f7: Waiting

41498acf7408: Waiting

7a283e294632: Waiting

9647196b2478: Pulling fs layer

9647196b2478: Waiting

bdfaf9dd363f: Pulling fs layer

834bb0ee027a: Pulling fs layer

bdfaf9dd363f: Waiting

44fb41d970a3: Verifying Checksum

44fb41d970a3: Download complete

8740c948ffd4: Verifying Checksum

8740c948ffd4: Download complete

1efc1fdb38f7: Verifying Checksum

1efc1fdb38f7: Download complete

41498acf7408: Verifying Checksum

41498acf7408: Download complete

8740c948ffd4: Pull complete

6123eca03eff: Verifying Checksum

6123eca03eff: Download complete

7a283e294632: Download complete

9647196b2478: Verifying Checksum

9647196b2478: Download complete

4b977f43e269: Download complete

834bb0ee027a: Verifying Checksum

834bb0ee027a: Download complete

bdfaf9dd363f: Verifying Checksum

bdfaf9dd363f: Download complete

4b977f43e269: Pull complete

44fb41d970a3: Pull complete

1efc1fdb38f7: Pull complete

41498acf7408: Pull complete

663c64010fc2: Download complete

663c64010fc2: Pull complete

6123eca03eff: Pull complete

7a283e294632: Pull complete

9647196b2478: Pull complete

bdfaf9dd363f: Pull complete

834bb0ee027a: Pull complete

Digest: sha256:451d6be1807060e3e026afcaf7efaf56eb294cbb8c11ddaa7158cb19d0994687

Status: Downloaded newer image for $DOCKER_HUB_ID/$DOCKER_REPO:amxmodx-tfc-1-9-0-5271

---\> 1834dce756e8

Step 2/49 : COPY "orpheu-files-2.6.3/" "/home/steam/tfc-server/tfc/addons/amxmodx/"

---\> aa2296d28bba

Step 3/49 : COPY "serverdatabase-fork/" "/home/steam/amxmodx-plugins/ServerDatabase"

---\> 031b343b9086

Step 4/49 : RUN cp "/home/steam/amxmodx-plugins/ServerDatabase/ServerDatabase.sma" "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/"

---\> Running in 24d3f96e2279

Removing intermediate container 24d3f96e2279

---\> d0ec38b2983a

Step 5/49 : RUN cp "/home/steam/amxmodx-plugins/ServerDatabase/hlstriker_server_db.inc" "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/include/"

---\> Running in 8fe5e47d73d9

Removing intermediate container 8fe5e47d73d9

---\> 5bb1abdff852

Step 6/49 : WORKDIR "/home/steam/tfc-server/tfc/addons/amxmodx/scripting"

---\> Running in 74278fdec036

Removing intermediate container 74278fdec036

---\> 64b5534a5dfa

Step 7/49 : RUN "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc" "ServerDatabase.sma"

---\> Running in 9d4a0919a30a

/bin/sh: 1: /home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc: Exec format error

The command '/bin/sh -c "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc" "ServerDatabase.sma"' returned a non-zero code: 126

2023-12-07T21:46:33.272799398Z stdout P


author: tohellwithtinytim
body: Hey [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) , thank you for reaching out.

See below.

The build fails when it attempts to run the 32-bit executable (amxxpc) during the Dockerfile build.

However, this all works fine when I use a self-hosted runner on Ubuntu 20.04.

<br />

bitbucket-pipelines.yml  
-----------------------

image: seaoddit/atlassian-builder-image-ia32

pipelines:  
branches:  
dev:  
- step:  
script:  
- git submodule update --init --recursive  
- apt-get update \&\& apt-get --yes --force-yes install lib32z1 lib32ncurses5 lib32bz2-1.0  
- docker login -u $DOCKER_HUB_ID -p $DOCKER_HUB_PASSWORD  
- docker build --platform="linux/amd64" -t $DOCKER_HUB_ID/$DOCKER_REPO:latest .  
- docker push $DOCKER_HUB_ID/$DOCKER_REPO:latest  
options:  
docker: true

<br />

Dockerfile being built  
-----------------------

FROM seaoddit/tfc-batcave:amxmodx-tfc-1-9-0-5271

# Orpheu 2.6.3

COPY "orpheu-files-2.6.3/" "/home/steam/tfc-server/tfc/addons/amxmodx/"

# ServerDatabase

COPY "serverdatabase-fork/" "/home/steam/amxmodx-plugins/ServerDatabase"  
RUN cp "/home/steam/amxmodx-plugins/ServerDatabase/ServerDatabase.sma" "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/"  
RUN cp "/home/steam/amxmodx-plugins/ServerDatabase/hlstriker_server_db.inc" "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/include/"  
WORKDIR "/home/steam/tfc-server/tfc/addons/amxmodx/scripting"  
#RUN \["/home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc", "ServerDatabase.sma"\]  
RUN "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc" "ServerDatabase.sma"  
RUN mv "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/ServerDatabase.amxx" "/home/steam/tfc-server/tfc/addons/amxmodx/plugins/"  
RUN echo "ServerDatabase.amxx" \>\> "/home/steam/tfc-server/tfc/addons/amxmodx/configs/plugins.ini"

Pipelines Build Return  
-----------------------

docker build --platform="linux/amd64" -t $DOCKER_HUB_ID/$DOCKER_REPO:latest .23s

+ docker build --platform="linux/amd64" -t $DOCKER_HUB_ID/$DOCKER_REPO:latest .

Sending build context to Docker daemon 2.039MB

Step 1/49 : FROM $DOCKER_HUB_ID/$DOCKER_REPO:amxmodx-tfc-1-9-0-5271

amxmodx-tfc-1-9-0-5271: Pulling from $DOCKER_HUB_ID/$DOCKER_REPO

8740c948ffd4: Pulling fs layer

4b977f43e269: Pulling fs layer

44fb41d970a3: Pulling fs layer

1efc1fdb38f7: Pulling fs layer

41498acf7408: Pulling fs layer

663c64010fc2: Pulling fs layer

6123eca03eff: Pulling fs layer

7a283e294632: Pulling fs layer

663c64010fc2: Waiting

6123eca03eff: Waiting

1efc1fdb38f7: Waiting

41498acf7408: Waiting

7a283e294632: Waiting

9647196b2478: Pulling fs layer

9647196b2478: Waiting

bdfaf9dd363f: Pulling fs layer

834bb0ee027a: Pulling fs layer

bdfaf9dd363f: Waiting

44fb41d970a3: Verifying Checksum

44fb41d970a3: Download complete

8740c948ffd4: Verifying Checksum

8740c948ffd4: Download complete

1efc1fdb38f7: Verifying Checksum

1efc1fdb38f7: Download complete

41498acf7408: Verifying Checksum

41498acf7408: Download complete

8740c948ffd4: Pull complete

6123eca03eff: Verifying Checksum

6123eca03eff: Download complete

7a283e294632: Download complete

9647196b2478: Verifying Checksum

9647196b2478: Download complete

4b977f43e269: Download complete

834bb0ee027a: Verifying Checksum

834bb0ee027a: Download complete

bdfaf9dd363f: Verifying Checksum

bdfaf9dd363f: Download complete

4b977f43e269: Pull complete

44fb41d970a3: Pull complete

1efc1fdb38f7: Pull complete

41498acf7408: Pull complete

663c64010fc2: Download complete

663c64010fc2: Pull complete

6123eca03eff: Pull complete

7a283e294632: Pull complete

9647196b2478: Pull complete

bdfaf9dd363f: Pull complete

834bb0ee027a: Pull complete

Digest: sha256:451d6be1807060e3e026afcaf7efaf56eb294cbb8c11ddaa7158cb19d0994687

Status: Downloaded newer image for $DOCKER_HUB_ID/$DOCKER_REPO:amxmodx-tfc-1-9-0-5271

---\> 1834dce756e8

Step 2/49 : COPY "orpheu-files-2.6.3/" "/home/steam/tfc-server/tfc/addons/amxmodx/"

---\> aa2296d28bba

Step 3/49 : COPY "serverdatabase-fork/" "/home/steam/amxmodx-plugins/ServerDatabase"

---\> 031b343b9086

Step 4/49 : RUN cp "/home/steam/amxmodx-plugins/ServerDatabase/ServerDatabase.sma" "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/"

---\> Running in 24d3f96e2279

Removing intermediate container 24d3f96e2279

---\> d0ec38b2983a

Step 5/49 : RUN cp "/home/steam/amxmodx-plugins/ServerDatabase/hlstriker_server_db.inc" "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/include/"

---\> Running in 8fe5e47d73d9

Removing intermediate container 8fe5e47d73d9

---\> 5bb1abdff852

Step 6/49 : WORKDIR "/home/steam/tfc-server/tfc/addons/amxmodx/scripting"

---\> Running in 74278fdec036

Removing intermediate container 74278fdec036

---\> 64b5534a5dfa

Step 7/49 : RUN "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc" "ServerDatabase.sma"

---\> Running in 9d4a0919a30a

/bin/sh: 1: /home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc: Exec format error

The command '/bin/sh -c "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc" "ServerDatabase.sma"' returned a non-zero code: 126

2023-12-07T21:46:33.272799398Z stdout P


author: tohellwithtinytim
body: Hey [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) , thank you for reaching out.

See below.

The build fails when it attempts to run the 32-bit executable (amxxpc) during the Dockerfile build.

However, this all works fine when I use a self-hosted runner on Ubuntu 20.04.

<br />

bitbucket-pipelines.yml  
-----------------------

image: seaoddit/atlassian-builder-image-ia32

pipelines:  
branches:  
dev:  
- step:  
script:  
- git submodule update --init --recursive  
- apt-get update \&\& apt-get --yes --force-yes install lib32z1 lib32ncurses5 lib32bz2-1.0  
- docker login -u $DOCKER_HUB_ID -p $DOCKER_HUB_PASSWORD  
- docker build --platform="linux/amd64" -t $DOCKER_HUB_ID/$DOCKER_REPO:latest .  
- docker push $DOCKER_HUB_ID/$DOCKER_REPO:latest  
options:  
docker: true

<br />

Dockerfile being built  
-----------------------

RUN "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc" "ServerDatabase.sma"  
RUN mv "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/ServerDatabase.amxx" "/home/steam/tfc-server/tfc/addons/amxmodx/plugins/"  
RUN echo "ServerDatabase.amxx" \>\> "/home/steam/tfc-server/tfc/addons/amxmodx/configs/plugins.ini"

Pipelines Build Return  
-----------------------

<br />

---\> Running in 9d4a0919a30a

/bin/sh: 1: /home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc: Exec format error

The command '/bin/sh -c "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc" "ServerDatabase.sma"' returned a non-zero code: 126

2023-12-07T21:46:33.272799398Z stdout P


author: Theodora Boudale
body: Hi [@tohellwithtinytim](/t5/user/viewprofilepage/user-id/5377885),

Thank you for the info.

Could you perhaps share the base image you use in the Dockerfile (in case it's a public Docker image) and also the commands from the Dockerfile up until you receive this error so that I reproduce and investigate further?

Kind regards,  
Theodora


author: tohellwithtinytim
body: Hey [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086)

The base image from the Dockerfile should now be public:

**docker pull seaoddit/tfc-batcave:amxmodx-tfc-1-9-0-5271**

I've simplified the Dockerfile for purposes of troubleshooting:

```
?
```

```
FROM seaoddit/tfc-batcave:amxmodx-tfc-1-9-0-5271

WORKDIR "/home/steam/tfc-server/tfc/addons/amxmodx/scripting"

RUN "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/amxxpc" "/home/steam/tfc-server/tfc/addons/amxmodx/scripting/timeleft.sma"
```

Here are the results of a successful run using a self-hosted runner: <https://pastebin.com/0DKdu4sT>

And here are the results of a failed run using bitbucket: <https://pastebin.com/xJHyBP2k>


author: Theodora Boudale
body: Hi [@tohellwithtinytim](/t5/user/viewprofilepage/user-id/5377885),

Thank you for the all details you shared, I was able to reproduce the issue as well. I am going to raise a support ticket on your behalf so we can fix this for your workspace.

You will receive shortly an email with a link to the support ticket. Just in case you don't receive it, please feel free to let me know and I can post the ticket URL here. The ticket will be visible only to you and Atlassian staff, no one else can view its content even if they have the URL.

Please feel free to reach out if you need anything further.

Kind regards,  
Theodora


author: Shyam
body: Hello [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) ,  

I have a similar issue in my workspace. One of my build runs fine in my local docker . but it fails in bitbucket pipeline, I have asked a question and explained the issue there, can you please help ?   

<https://community.atlassian.com/t5/Bitbucket-questions/Docker-build-fails-in-bitbucket-pipeline-but-runs-fine-locally/qaq-p/2712423#M104700>


author: Theodora Boudale
body: Hi [@Shyam](/t5/user/viewprofilepage/user-id/5441848),

I will reply to the question you created.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud