Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to build #7

Open
marcbria opened this issue Sep 11, 2019 · 6 comments
Open

Fails to build #7

marcbria opened this issue Sep 11, 2019 · 6 comments

Comments

@marcbria
Copy link

marcbria commented Sep 11, 2019

Dockerfile fails to install mysql-server:

Step 7/20 : RUN echo 'mysql-server mysql-server/root_password password r00t' | debconf-set-selections &&     echo 'mysql-server mysql-server/root_password_again password r00t'| debconf-set-selections &&     apt-get install mysql-server -y &&     /etc/init.d/mysql stop
 ---> Running in fc2275e3ec08
Reading package lists...
Building dependency tree...
Reading state information...
Package mysql-server is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'mysql-server' has no installation candidate
The command '/bin/sh -c echo 'mysql-server mysql-server/root_password password r00t' | debconf-set-selections &&     echo 'mysql-server mysql-server/root_password_again password r00t'| debconf-set-selections &&     apt-get install mysql-server -y &&     /etc/init.d/mysql stop' returned a non-zero code: 100

BTW, why not including the project in dockerhub?
Are you planning to release a docker-compose?

Thanks for your work,
m.

@PeGa
Copy link

PeGa commented Sep 12, 2019

Hi @marcbria, at the time this Dockerfile was created, probably Debian Jessie was "latest". Considering that Debian Buster (current "latest") introduced a lot of breaking changes, I'd suggest you to try with FROM debian:jessie.

We might include a docker-compose.yml file altogether with a brand new Dockerfile some time in the future. However, it's unclear for us if it will be in the docker hub.

Regards.

@manfredsteger
Copy link

hi @PeGa tried with FROM debian:jessie

but there is an error at starting mysqld:

Starting MySQL database server: mysqld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed! The command '/bin/sh -c apt-get install php5 php5-mysql git wget curl php5-curl php5-intl phpunit vim -y && /etc/init.d/mysql start && echo "CREATE DATABASE timegrid_dev CHARACTER SET utf8 COLLATE utf8_general_ci; GRANT ALL ON timegrid_dev.* TO 'timegrid_dev'@localhost IDENTIFIED BY 'tgpass';" | mysql -pr00t && echo "CREATE DATABASE testing_timegrid CHARACTER SET utf8 COLLATE utf8_general_ci; GRANT ALL ON testing_timegrid.* TO 'testing_timegrid'@localhost IDENTIFIED BY 'testing_timegrid';" | mysql -pr00t && /etc/init.d/mysql stop' returned a non-zero code: 1

Can you help? Ty very much.

Image on hub.docker would be great :D

@minhtt159
Copy link

Seeded: NotifynderCategoriesSeeder
Seeded the Notifynder Categories!
Seeded: CategoriesSeeder
Seeded the Param Categories!
Seeded: CountriesSeeder
Seeded the Param Countries!
Seeded: RolesTableSeeder
Seeded the Param Roles!
Updating...


  [ErrorException]
  get_headers(): php_network_getaddresses: getaddrinfo failed: Name or service not known


The command '/bin/sh -c /etc/init.d/mysql start &&     php artisan migrate --seed --database=testing &&     php artisan key:generate &&     php artisan migrate &&     php artisan db:seed &&     php artisan geoip:update &&     /etc/init.d/mysql stop' returned a non-zero code: 1

I edited debian:latest -> debian:jessie and having this problem.
Maybe php in docker requires some thing more?

@minhtt159
Copy link

This is not the answer for your question, but I can manage to have the service start and running.

  1. Pull this dockerfile from the repo
  2. Comment out these line
RUN /etc/init.d/mysql start && \
    php artisan migrate --seed --database=testing && \
    php artisan key:generate && \
    php artisan migrate && \
    php artisan db:seed && \
    php artisan geoip:update && \
    /etc/init.d/mysql stop

CMD /etc/init.d/mysql start && tail -f /dev/null
  1. Build docker image:
outside docker $> sudo docker build -t timegrid --build-arg user=$(whoami) --build-arg uid=$(id -u) .
  1. Run docker image with -it:
outside docker $> sudo docker run -it -p 8000:8000 timegrid:latest /bin/bash
  1. Finish what you have commented out:
inside docker $> /etc/init.d/mysql start && php artisan migrate --seed --database=testing && php artisan key:generate && php artisan migrate && php artisan db:seed && php artisan serve --host 0.0.0.0
  1. Profit

@Frozen-byte
Copy link

@minhtt159 Your guide is nice, thank you.

I pinned the issue further down to the php artisan geoip:update && \ line. Yet I have no clue why it fails. Any Suggestions?

@minhtt159
Copy link

@minhtt159 Your guide is nice, thank you.

I pinned the issue further down to the php artisan geoip:update && \ line. Yet I have no clue why it fails. Any Suggestions?

I believe that mysql server must run "all the time", also "in a different container".
You can not start mysql server in the docker image. It doesn't work like that.
You can design a mechanism that when docker container is starting, run the script that start mysql server and create database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants