mercredi 22 avril 2015

C compiler on EC2 not working when using Elastic Beanstalk container_commands

I've been trying to install some binaries in my EC2 instances using Elastic Beanstalk container_commands and a custom shell script. When the container command fires, I basically wget a library, uncompress it, configure it and make && make install it like so:

wget LIBRARY_URL
mkdir -p libfolder
tar xf LIBRARY.tar.gz -C libfolder --strip-components 1
cd libfolder
./configure
make clean
make install

On the ./configure step I get the following:

checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... no

So I get from here that the C compiler doesn't work yet gcc is already installed. The whole container_command fails to do what the shell script says.

Nevertheless, when is SSH into the EC2 instance, if I manually execute the shell script then everything goes smoothly and the "C compiler works..." check returns "yes".

Here is the according .ebextensions config YAML file that I use:

packages:
  yum:
    gcc: []
    make: []
    openssl-devel: []
    libxml2: []
    libxml2-devel: []
container_commands:
  01setupaudio:
    command: "sh audio.sh"

I am wondering why this is and if the reason this happens is because container_commands run first and then packages get installed, because the fact that SSHing into the instance and running the shell script manually confirms that there is no problem with it.

Any help would be much appreciated.




Aucun commentaire:

Enregistrer un commentaire