Giter Site home page Giter Site logo

Comments (10)

vcttai avatar vcttai commented on July 18, 2024 2

For christian-charzewski-now's problem, I found a solution a it worked for me.

We have to make startup.sh executable before we mount it into container, by this command:

chmod +x startup.sh

After that, this line can run without such that error:

docker run --rm -v $PWD/startup.sh:/etc/container/startup.sh thecodingmachine/php:8.0-v4-slim-apache

Hope this helps.

from docker-images-php.

moufmouf avatar moufmouf commented on July 18, 2024

Hey @tehmaestro,

I can confirm I reproduce your issue. I'll look into it.

In the meantime, you can use the environment variable STARTUP_COMMAND_XXX to execute startup commands:

STARTUP_COMMAND_1: sudo service ssh start

Note: I'm not sure the image contains a SSH server so this very command might not work. Are you sure you want to start a SSH server in the container? Usually, one would rather "exec" the "bash" command to connect to a container.

from docker-images-php.

tehmaestro avatar tehmaestro commented on July 18, 2024

Hi, thanks for the info. Yes, I am already using the startup command as a workaround and it works!
I'm deploying my container to Azure WebApp for Containers and I followed their instructions for installing the ssh server and exposing port 2222, in order to be able to ssh into the container. I am already installing openssh

PS: Freaking awesome docker image. Really cool! Thanks.

from docker-images-php.

moufmouf avatar moufmouf commented on July 18, 2024

PS: Freaking awesome docker image. Really cool! Thanks.

Thanks!

Issue is fixed. The image is currently building so you can "docker pull" the new image in about 40 minutes.

from docker-images-php.

christian-charzewski-now avatar christian-charzewski-now commented on July 18, 2024

I get the same error message with php:7.4-v3-slim-apache

docker run --rm -v startup.sh:/etc/container/startup.sh thecodingmachine/php:7.4-v3-slim-apache
sudo: /etc/container/startup.sh: command not found

My Startup.sh

#!/usr/bin/env bash

echo "startup.sh executed"

from docker-images-php.

moufmouf avatar moufmouf commented on July 18, 2024

@christian-charzewski-now

Ok, I'm reopening the issue until I find where this comes from.

from docker-images-php.

moufmouf avatar moufmouf commented on July 18, 2024

@christian-charzewski-now

Found it! The error is not in the image but in your test command line. With Docker, you must put an absolute path when mounting directories.

So the correct test line is:

docker run --rm -v $PWD/startup.sh:/etc/container/startup.sh thecodingmachine/php:7.4-v3-slim-apache

(pay attention to the $PWD/ in front of "/startup.sh")

from docker-images-php.

christian-charzewski-now avatar christian-charzewski-now commented on July 18, 2024

@moufmouf

I still get the same error - does it work for you?

from docker-images-php.

moufmouf avatar moufmouf commented on July 18, 2024

Mmmm... yes it does.
Are you running this from the directory that contains "startup.sh"?

Also, could you try to download the latest version of the image bu running:

docker pull thecodingmachine/php:7.4-v3-slim-apache

from docker-images-php.

christian-charzewski-now avatar christian-charzewski-now commented on July 18, 2024

Strange

Pulling a new image didn't help either

docker pull thecodingmachine/php:7.4-v3-slim-apache

7.4-v3-slim-apache: Pulling from thecodingmachine/php
Digest: sha256:7ea9e7ed6779299af2aec0ee9b361eb1d8323bb5964db20e2e6d706d23c830b5
Status: Image is up to date for thecodingmachine/php:7.4-v3-slim-apache
docker.io/thecodingmachine/php:7.4-v3-slim-apache

I also tried building a docker image and copying the file to /etc/container/startup.sh and i still get the same error.

For now i solved it with the STARTUP_COMMAND_XXX env variables, so its not a real problem.

from docker-images-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.