Yucked
Yucked

Reputation: 321

Docker Ubuntu Picking Wrong Directory

I'm fairly new to Docker and trying to familarize myself by trying to run a Steam server inside it.

My Dockerfile is as follow:

FROM ubuntu:20.10

RUN dpkg --add-architecture i386 \ 
    && apt-get update \
    && apt-get install -y \
    curl \
    ca-certificates \
    libgcc1 \
    && apt-get clean autoclean \
    && apt-get autoremove -y \
    && rm -rf /var/lib/apt/lists/*

RUN mkdir -p steam/cmd \
    && cd steam \
    && curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf - -C cmd

RUN ./steam/cmd/steamcmd.sh +quit

I can't figure out why the last step throws this error:

Step 4/4 : RUN ./steam/cmd/steamcmd.sh +quit
 ---> Running in c3f673328fe6
./steam/cmd/steamcmd.sh: line 37: /steam/cmd/linux32/steamcmd: No such file or directory
The command '/bin/sh -c ./steam/cmd/steamcmd.sh +quit' returned a non-zero code: 127

Why does ./steam/cmd/steamcmd.sh gets translated into /steam/cmd/linux32/steamcmd?

Step 3/3 isn't placing steamcmd.sh inside linux32.

Step 3/4 : RUN mkdir -p steam/cmd     && cd steam     && curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf - -C cmd
 ---> Running in fa5dcd1fcadc
steamcmd.sh
linux32/steamcmd
linux32/steamerrorreporter
linux32/libstdc++.so.6
linux32/crashhandler.so

Using WORKDIR steam/cmd then following it up with RUN returns the same result as well.

Upvotes: 0

Views: 976

Answers (1)

Peaceful James
Peaceful James

Reputation: 2235

See this discussion: https://askubuntu.com/questions/133389/no-such-file-or-directory-but-the-file-exists

Try doing apt install libc6-i386 as part of step 2.

RUN dpkg --add-architecture i386 \ 
    && apt-get update \
    && apt-get install -y \
    curl \
    ca-certificates \
    libgcc1 \
    libc6-i386 \
    && apt-get clean autoclean \
    && apt-get autoremove -y \
    && rm -rf /var/lib/apt/lists/*

Also jfyi, the sh file is not being "translated" as you think.

If you actually open that sh, you will see it tries to call the linux32 executable (which it calls $STEAMEXE).

If you want to be able to fix things like this yourself, here is how I investigated it:

  1. I copied your dockerfile, but commented/deleted the last (broken) step.
  2. I built the image with docker build -t helpthiscoder .
  3. I got on the image with docker start helpthiscoder; docker run -i -t helpthiscoder bash
  4. I looked inside the sh file on the image. apt update; apt install vim; vim /steam/cmd/steamcmd.sh.
  5. Inside this file, I added my own echo $STEAMEXE to see that the path was /steam/cmd/linux32/steamcmd.
  6. I went to /steam/cmd/linux32 and ran ls -lah to see that file was present and executable.
  7. I ran file steamcmd to get info. Then I saw it was 32-bit.
  8. Then I googled linux 32-bit file not found error Ubuntu 20 and found the link I mentioned in the first paragraph. :/

I get a different error now though:

Redirecting stderr to '/root/Steam/logs/stderr.txt'
threadtools.cpp (3787) : Assertion Failed: Probably deadlock or failure waiting for thread to initialize.
ILocalize::AddFile() failed to load file "public/steambootstrapper_english.txt".
[  0%] Checking for available update...
threadtools.cpp (3787) : Assertion Failed: Probably deadlock or failure waiting for thread to initialize.
Thread failed to initialize
CWorkThreadPool::StartWorkThread: Thread creation failed.
Exiting on SPEW_ABORT

I will keep looking into it. I strongly advise you delete your last broken line and build an image that you can "explore" in the way I mentioned above. That's how I'm getting this new error.

Upvotes: 3

Related Questions