in Education by
I've written a Dockerfile with the intent of hosting a game server in a Docker container, but the shell script ("run.sh") that is COPY'd into the container doesn't see the ELF executable it is supposed to run. I've configured my Dockerfile such that it uses the latest version of the ubuntu package, downloads and extracts the game server's files to a new folder, and then deletes the .zip archive. It successfully builds, but when I attempt to run it with a simple shell script consisting of three lines: run.sh: #!/usr/bin/env bash pwd ls exec ./TerrariaServer.bin.x86 -steam -config ./config.txt it always presents the following error:./run.sh: line 4: /ServerFiles/TerrariaServer.bin.x86: No such file or directory pwd and ls confirm that TerrariaServer.bin.x86 is present in the /ServerFiles/ directory: /ServerFiles FNA.dll FNA.dll.config Mono.Posix.dll Mono.Security.dll System.Configuration.dll System.Core.dll System.Data.dll System.Drawing.dll System.Numerics.dll System.Runtime.Serialization.dll System.Security.dll System.Windows.Forms.dll System.Windows.Forms.dll.config System.Xml.Linq.dll System.Xml.dll System.dll Terraria.png TerrariaServer --> TerrariaServer.bin.x86 <-- TerrariaServer.bin.x86_64 TerrariaServer.exe WindowsBase.dll changelog.txt config.txt lib lib64 monoconfig monomachineconfig mscorlib.dll open-folder run.sh Other answers I've seen on StackOverflow have pointed to permissions conflicts (I've applied chmod 777 liberally for testing purposes) and Windows line endings (the Dockerfile and run.sh were both created and edited through nano via PuTTY), but no changes I make seem to affect the outcome. Dockerfile: FROM ubuntu:latest # Get wget package RUN apt-get update \ && apt-get install -y wget \ && apt-get install -y unzip \ && rm -rf /var/lib/apt/lists/* #RUN apt-get install dos2unix # Download and extract Terraria server files RUN pwd \ && mkdir Downloads RUN cd Downloads \ && wget -O "/Downloads/TServer.zip" http://terraria.org/server/terraria-server-1353.zip \ && ls RUN unzip "/Downloads/TServer.zip" -d "/Downloads/TServer/" # Extract the linux folder and delete old files/folders RUN cp -ra "/Downloads/TServer/1353/Linux/" "/ServerFiles/" \ && rm -rf "/Downloads/TServer.zip" \ && rm -rf "/Downloads/TServer/" COPY run.sh /ServerFiles/run.sh RUN chmod 777 /ServerFiles/run.sh # Set the working directory WORKDIR "/ServerFiles/" RUN ls RUN chmod 777 . RUN chmod 777 TerrariaServer.bin.x86 RUN adduser --disabled-password --gecos '' tserveruser \ && adduser tserveruser sudo RUN chown -R tserveruser:tserveruser /ServerFiles RUN chown tserveruser:tserveruser /ServerFiles/TerrariaServer USER tserveruser # Create the default config.txt RUN printf "maxplayers=8\nport=7777\npassword=testpass\nworldpath=~/ServerFiles/Worlds/\ndifficulty=0\nautocreate=2\nworldname=World" \ > config.txt ENTRYPOINT ["./run.sh"] JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
A stab in the dark...the only thing that I can think of that would explain the behavior you're seeing given all of the data you've so nicely produced and provided... Is /ServerFiles/TerrariaServer.bin.x86 possibly a symbolic link that is not pointing to an existing file? That would produce both the listing you show and the error you're getting when trying to run that "file". It could also be that it is pointing to a file without the proper permissions. If that's not it, maybe you should do a "ls -l" to see if that happens to provide any clues.

Related questions

0 votes
    the directory /Library/Frameworks/Python.framework/ contains the following four elements: Headers Python Resources ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 18, 2022 in Education by JackTerrance
0 votes
    I am getting the following message in android LogCat 03-20 01:45:03.362: WARN/System.err(369): ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 10, 2022 in Education by JackTerrance
0 votes
    I have referred to this guide: http://hyperledger-fabric.readthedocs.io/en/latest/Setup/Chaincode-setup/#option-1 ... file or directory Select the correct answer from above options...
asked Jan 23, 2022 in Education by JackTerrance
+1 vote
    Is it possible to create a custom domain name, or use your organisation's domain name such as eduforum.in, in Azure Active Directory?...
asked Oct 20, 2020 in Technology by JackTerrance
0 votes
    Why there is a need to move the existing directory into a new repository? How this can be done in SVN?...
asked Feb 18, 2021 in Technology by JackTerrance
0 votes
    The transaction can no longer continue with its normal execution because of some internal condition, such ... topic in chapter Recovery System of Database Management...
asked Oct 10, 2021 in Education by JackTerrance
0 votes
    What is the command on the menu bar to save? (a) a new file, (b) existing file..please? Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    What is the command on the menu bar to save? (a) a new file, (b) existing file..please? Select the correct answer from above options...
asked Dec 18, 2021 in Education by JackTerrance
0 votes
    I am facing problems in _files which isn't defined if I execute the script with exec, ececfile and in _module_ ... help me with this? Select the correct answer from above options...
asked Jan 21, 2022 in Education by JackTerrance
0 votes
    What is the difference between CMD and ENTRYPOINT?...
asked Jun 20, 2021 in Technology by JackTerrance
0 votes
    What are the most commonly used instructions in Dockerfile?...
asked Jun 20, 2021 in Technology by JackTerrance
0 votes
0 votes
    When I am running a Hadoop .jar file from the command prompt, it throws an exception saying no such method ... (Child.java:264) Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    If the state of the database no longer reflects a real state of the world that the database is supposed ... , Database Interview Questions and Answers for Freshers and Experience...
asked Oct 11, 2021 in Education by JackTerrance
...