Docker - Installing Composer /bin/sh: 1: php: not found curl: (23) Failed writing body (0 != 16133)

Asked
Active3 hr before
Viewed126 times

8 Answers

failedfoundinstallingdocker
90%

There's no "more or less", only one of each is permitted, with the most recently defined taking precedence. Also, installing more than one service per container is generally considered bad practice. Look at something like docker-compose or kubernetes. – Sammitch Jan 10 '19 at 20:55 ,Then, you'll probably also want to start a second container for your nginx service. You could do this manually using docker run, but I suggest checking out docker-compose. It helps you build and run multiple containers at once.,You can only have one base image using FROM in a Dockerfile. Basically, that tells docker what to start with. In your case, you have several FROMs, so it appears that Docker simply takes the last one you give it, in this case node:8. So PHP is never being installed.,To fix this issue, you'll need to pick a single base image (for example php), and install your other dependencies on top of that, so you could manually install nginx and node on top of the php image using RUN. You may also want to consider building a separate nginx image. This is considered good practice to separate your services into different images when possible.

Also, instead of using multiple CMD entries, use a small startup shell script. For example

#!/usr/bin/env bash

set - e
php artisan migrate: fresh--seed
php artisan config: cache
php artisan route: cache
exec php artisan serve--host = 0.0 .0 .0--port = 436
load more v
88%

bash: php: command not found curl: (23) Failed writing body (0 != 16133),args... Arguments passed to script. curl: (23) Failure writing output to destination,Here is info on the related curl command line switches,@dimkir, @vinnizworld Easiest way to download and move file to /usr/local/bin folder.

Here is info on the related curl command line switches

     -s, --silent
     Silent or quiet mode.Don 't show progress meter or error mes‐
     sages.Makes Curl mute.It will still output the data you ask
     for, potentially even to the terminal / stdout unless you redirect
     it.

        -
        S, --show - error
     When used with - s it makes curl show an error message
     if it
     fails.
load more v
72%

curl: (23) неудачное тело записи (0 != 16133) ,это сообщение об ошибке: ,curl -s https://getcomposer.org/installer | Php --disable-tls ,bash: php: no se encontró la orden

Я пытаюсь установить symfony в debian 8 Джесси, но у меня есть проблема, когда я выполняю эту инструкцию в terminal:

curl - sS https: //getcomposer.org/installer | php
load more v
65%

Здравствуйте, я создаю dockerfile для моего проекта laravel. Это так далеко, Кроме того, моя рекомендация помочь мне создать этот файл Docker: https://buddy.works/guides/laravel-in-docker, Поместите это в скрипт с именем start.sh или что-то в этом роде, затем в вашем Dockerfile используйте

Здравствуйте, я создаю dockerfile для моего проекта laravel. Это так далеко

FROM php: 7.2 - cli
FROM nginx
FROM node: 8
MAINTAINER zachary tyhacz

# does not install mysql
# mysql is outside container

RUN apt - get update - y && apt - get install - y openssl zip unzip git
RUN curl - sS https: //getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

   WORKDIR /
   var / www / public
COPY. /
   var / www / public

COPY nginx.conf / etc / nginx / sites - available / domain
RUN ln - s / etc / nginx / sites - available / etc / nginx / sites - enabled

RUN npm install
RUN composer install

# sets up the database
CMD php artisan migrate: fresh--seed

# resets configuration files
CMD php artisan config: cache

# refreshes routes
CMD php artisan route: cache

# enables serve
CMD php artisan serve--host = 0.0 .0 .0--port = 436

EXPOSE 8080 / udp
EXPOSE 8080 / tcp
EXPOSE 80 / udp
EXPOSE 80 / tcp
EXPOSE 436 / tcp
EXPOSE 436 / udp

и он выбрасывает эту ошибку и останавливается.

/bin/sh: 1: php: not found
curl: (23) Failed writing body(0 != 16133)
load more v
75%

您好,我正在为我的laravel项目创建一个dockerfile。至此:

FROM php: 7.2 - cli
FROM nginx
FROM node: 8
MAINTAINER zachary tyhacz

# does not install mysql
# mysql is outside container

RUN apt - get update - y && apt - get install - y openssl zip unzip git
RUN curl - sS https: //getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

   WORKDIR /
   var / www / public
COPY. /
   var / www / public

COPY nginx.conf / etc / nginx / sites - available / domain
RUN ln - s / etc / nginx / sites - available / etc / nginx / sites - enabled

RUN npm install
RUN composer install

# sets up the database
CMD php artisan migrate: fresh--seed

# resets configuration files
CMD php artisan config: cache

# refreshes routes
CMD php artisan route: cache

# enables serve
CMD php artisan serve--host = 0.0 .0 .0--port = 436

EXPOSE 8080 / udp
EXPOSE 8080 / tcp
EXPOSE 80 / udp
EXPOSE 80 / tcp
EXPOSE 436 / tcp
EXPOSE 436 / udp
load more v
40%

I am trying to install docker with curl -fsSL get.docker.com -o get-docker.sh, Listings

it returns:

curl: (23) Failed writing body(0 != 13847)
22%

curl -sS https://getcomposer.org/installer php -- --install-dir=/usr/local/bin --filename=composer,curl -sS https://getcomposer.org/installer sudo php -- --install-dir=/usr/local/bin --filename=composer,curl -sS https://getcomposer.org/installer php -- --install-dir=/usr/local/bin --filename=composercomposer about,First install php then try to run this commandcurl -sS https://getcomposer.org/installer sudo php -- --install-dir=/usr/local/bin --filename=composer

I guess it is better to use curl -sS .. php because then you will get the error message in case curl fails. (also error will be sent to stdout thus it won't be sent to php interpreter)

curl - sS..php
load more v
60%

This guide shows you how to use Bitbucket Pipelines for building and testing a PHP software project in a Docker container.,Pipelines is an integrated CI/CD service built into Bitbucket. Learn how to build, test, and deploy code using Pipelines.,For instance if you wanted to install the gd extension as part of your build process you could do so with the following bitbucket-pipelines.yml:,Bitbucket Pipelines allows you to launch extra services during the execution of your pipeline by defining the service, and instantiating it on the appropriate step.

load more v