简体   繁体   中英

Error : standard_init_linux.go:228: exec user process caused: exec format error

When I use docker container I got the following error:

enter image description here

My computer is a 64-bit x64 operating system.docker version information 20.10.12.Ubuntu version is 20.03.

The docker log for running the command is as follows:

time="2022-01-03T10:50:26.312973100+08:00" level=info msg="starting signal loop" namespace=moby path=/run/docker/containerd/daemon/io.containerd.runtime.v2.task/moby/b1cbf20dd5864e91c0d3ebe0522cb0e589babf5a30bc88caa3b23dea52de8e14 pid=853
time="2022-01-03T10:50:27.431678700+08:00" level=info msg="ignoring event" container=b1cbf20dd5864e91c0d3ebe0522cb0e589babf5a30bc88caa3b23dea52de8e14 module=libcontainerd namespace=moby topic=/tasks/delete type="*events.TaskDelete"
time="2022-01-03T10:50:27.432538200+08:00" level=info msg="shim disconnected" id=b1cbf20dd5864e91c0d3ebe0522cb0e589babf5a30bc88caa3b23dea52de8e14
time="2022-01-03T10:50:27.434013300+08:00" level=error msg="copy shim log" error="read /proc/self/fd/14: file already closed"

This is my run.sh file

#!/bin/bash
HASH=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 4 | head -n 1)
GPU=$1
name=${USER}_pymarl_GPU_${GPU}_${HASH}

echo "Launching container named '${name}' on GPU '${GPU}'"
# Launches a docker container using our image, and runs the provided command

if hash nvidia-docker 2>/dev/null; then
  cmd=nvidia-docker
else
  cmd=docker
fi

NV_GPU="$GPU" ${cmd} run \
    --name $name \
    --user $(id -u):$(id -g) \
    -v `pwd`:/pymarl \
    -t pymarl:1.0 \
    ${@:2}

THis is my docker image

FROM nvidia/cuda:9.2-cudnn7-devel-ubuntu16.04
MAINTAINER Tabish Rashid

# CUDA includes
ENV CUDA_PATH /usr/local/cuda
ENV CUDA_INCLUDE_PATH /usr/local/cuda/include
ENV CUDA_LIBRARY_PATH /usr/local/cuda/lib64

# Ubuntu Packages
RUN apt-get update -y && apt-get install software-properties-common -y && \
    add-apt-repository -y multiverse && apt-get update -y && apt-get upgrade -y && \
    apt-get install -y apt-utils nano vim man build-essential wget sudo && \
    rm -rf /var/lib/apt/lists/*

# Install curl and other dependencies
RUN apt-get update -y && apt-get install -y curl libssl-dev openssl libopenblas-dev \
    libhdf5-dev hdf5-helpers hdf5-tools libhdf5-serial-dev libprotobuf-dev protobuf-compiler git
RUN curl -sk https://raw.githubusercontent.com/torch/distro/master/install-deps | bash && \
    rm -rf /var/lib/apt/lists/*

# Install python3 pip3
RUN apt-get update
RUN apt-get -y install python3
RUN apt-get -y install python3-pip
RUN pip3 install --upgrade "pip < 21.0"

# Python packages we use (or used at one point...)
RUN pip3 install numpy scipy pyyaml matplotlib
RUN pip3 install imageio
RUN pip3 install tensorboard-logger
RUN pip3 install pygame

RUN mkdir /install
WORKDIR /install

RUN pip3 install jsonpickle==0.9.6
# install Sacred (from OxWhirl fork)
# RUN pip3 install setuptools
RUN pip3 install --upgrade -vv setuptools
RUN git clone https://github.com/oxwhirl/sacred.git /install/sacred && cd /install/sacred && python3 setup.py install

#### -------------------------------------------------------------------
#### install pytorch
#### -------------------------------------------------------------------
RUN pip3 install torch
RUN pip3 install torchvision snakeviz pytest probscale

## -- SMAC
RUN pip3 install git+https://github.com/oxwhirl/smac.git
ENV SC2PATH /pymarl/3rdparty/StarCraftII

WORKDIR /pymarl

Please help.!!!I don't know how to fix it.

Put quotes around $GPU in your command (I'd include the fixed command here, but I can't copy/paste from a screenshot). It doesn't appear to be set, and without quotes, you're missing the python3 command that your container should be running (instead it's setting the gpu variable to python3 in your script).

Without the python3 command, it's trying to execute the python script, and it is likely missing the #! on the first line that would tell the kernel how to execute the script (this can also happen if the script isn't saved as utf-8 with Linux linefeeds).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM