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

Waiting for feedback before PR official docker-library repo #1

Closed
pierreozoux opened this issue Sep 23, 2015 · 26 comments
Closed

Waiting for feedback before PR official docker-library repo #1

pierreozoux opened this issue Sep 23, 2015 · 26 comments

Comments

@pierreozoux
Copy link
Collaborator

If you want to test, before following the instructions, make sure you build a local piwik image:

So the instructions will becore:

git clone https://github.com/piwik/docker-piwik.git
cd docker-piwik
docker build -t piwik .
# edit variables:
vi .env
docker-compose up
@bmoo
Copy link

bmoo commented Oct 1, 2015

Hi, I just stumbled on this repo while I was trying to dockerize piwik myself. I'm on a Mac here and I was getting some permissions problems with your setup so I made some edits to not mount directories back to my host. For example, - ./config:/var/www/html/config became - /var/www/html/config in my docker-compose.yml. This fixed my permission errors.

Now I'm unclear how the database should be initialized. When I docker-compose up -d, everything works, but now I'm asked to fill in my database information in the setup wizard and I never created a user or its password. Should I be creating this database manually or should I expect the docker-compose initialization to create it for me? It appears to be missing from the instructions.

@pierreozoux
Copy link
Collaborator Author

@bmoo thanks for your feedback!

Permission

What do you use to run docker on mac?
When you execute docker-compose, are you inside the git repo?
What is exactly the error?

Database init

I just updated https://github.com/piwik/docker-piwik/blob/master/README.md#installation
Let me know if it isn't clearer :)

Thanks,

Pierre

@bmoo
Copy link

bmoo commented Oct 1, 2015

Hey @pierreozoux

I use vmware-fusion 8 and docker-machine with the boot2docker image. And I'm in the git repo when I run compose. Here's the output -

brad at compy in ~/dev/docker-piwik (master●)
$ docker-compose up -d
Creating dockerpiwik_db_1...
Creating dockerpiwik_app_1...
Cannot start container b246481140e7439a1f369965f320b6c6d5261f655a5caa5786600afb61cb89a4: Cannot link to a non running container: /dockerpiwik_db_1 AS /dockerpiwik_app_1/db

brad at compy in ~/dev/docker-piwik (master●)
$ docker logs dockerpiwik_db_1
chown: changing ownership of `/var/lib/mysql/': Operation not permitted

I didn't need the db volume mapped to my host so I removed the mapping (as I described earlier) and that fixed the permission problem. Then I ran docker-compose kill && docker-compose rm to remove my old containers. Another docker-compose up -d completes successfully but docker-compose logs shows:

brad at compy in ~/dev/docker-piwik (master●●)
$ docker-compose logs
Attaching to dockerpiwik_cron_1, dockerpiwik_web_1, dockerpiwik_app_1, dockerpiwik_db_1
app_1  | tar: ./config/manifest.inc.php: Cannot change ownership to uid 1000, gid 1000: Operation not permitted
app_1  | tar: ./config/global.ini.php: Cannot change ownership to uid 1000, gid 1000: Operation not permitted
app_1  | tar: ./config/global.php: Cannot change ownership to uid 1000, gid 1000: Operation not permitted
app_1  | tar: ./config/environment/test.php: Cannot change ownership to uid 1000, gid 1000: Operation not permitted
app_1  | tar: ./config/environment/dev.php: Cannot change ownership to uid 1000, gid 1000: Operation not permitted
app_1  | tar: ./config/environment: Cannot change ownership to uid 1000, gid 1000: Operation not permitted
app_1  | tar: ./config: Cannot change ownership to uid 1000, gid 1000: Operation not permitted
app_1  | tar: Exiting with failure status due to previous errors
db_1   | Running mysql_install_db
...

Removing the ./config host mount in the app container fixes this problem and then everything works. It seems likely that this is due to the fact that the uid/gid used by the container doesn't map to anything known by my host, but I haven't dug any further yet.

@bmoo
Copy link

bmoo commented Oct 1, 2015

One way to solve this might be to put these externalized files and folders in a data container that is built from the same base image as the rest. Then the uid/gids would be consistent between the app and its volume mount.

@pierreozoux
Copy link
Collaborator Author

Hum, thanks for your comment.
I never ran into this...
Do you use latest version of compose and docker?

@bmoo
Copy link

bmoo commented Oct 1, 2015

Yes

@jgillich
Copy link

I just installed Piwik with this image, worked great. 👍

@pierreozoux
Copy link
Collaborator Author

Thanks @jgillich for the feedback. And thanks @bmoo also!

It looks like everything is sorted out :)

@j-a-m-l
Copy link

j-a-m-l commented Nov 4, 2015

In my case this image worked flawlessly. In fact, I have built one temporal image for using it until having this real official one online (jaml/tmp-official-piwik).

Good job!

@pierreozoux
Copy link
Collaborator Author

Ok, I'll PR to official repo (probably beginning of next week)

@cusspvz
Copy link

cusspvz commented Dec 11, 2015

Is there a change to have an alpine version of this image? In large scale clusters, image size matters.

@pierreozoux
Copy link
Collaborator Author

This would be a nice to have indeed.
We could have 2 tags piwik and piwik-light.

I'd be glad to accept a PR to this repo, then we'll have to figure ot
how to organise.

(The size doesn't matter that much, I use debian for all my cluster, and
indeed, I just download piwik, but well, I agree, it is in general more
satisfying from an engineering point of view)

On 11-12-2015 11:49, José Moreira wrote:

Is there a change to have an alpine version of this image? In large
scale clusters, image size matters.


Reply to this email directly or view it on GitHub
#1 (comment).

@cusspvz
Copy link

cusspvz commented Dec 16, 2015

@pierreozoux thanks for your response.

I'm gonna create an internal one and then an open-source one.
Is there a specific reason why you're dividing php-fpm service from nginx one?

@pierreozoux
Copy link
Collaborator Author

One service per container is a best practice.

On 16-12-2015 15:50, José Moreira wrote:

@pierreozoux thanks for your response.

I'm gonna create an internal one and then an open-source one.
Is there a specific reason why you're dividing php-fpm service from nginx one?


Reply to this email directly or view it on GitHub:
#1 (comment)

I use PGP to protect our privacy, if you want to know more, you can
follow this
https://emailselfdefense.fsf.org/en/

If you have further questions, please do not hesitate to ask.
You can verify my public key here: https://keybase.io/pierreozoux

@cusspvz
Copy link

cusspvz commented Dec 16, 2015

Yep, I know... 😞 But for scale them up separately I have to configure also confd on the nginx side, which invalidates the One service per container practice, not to mention it would make it difficult to support different container-based service discoveries...

Seems that I'm gonna choose to build up the internal image with an HTTP endpoint instead.

By the way, IMHO, I think the way this image is accepting configurations (through volume file sharing) makes it hardener to deploy. That is the main reason that took me to build a new one instead.

@MikeMichel
Copy link

separate php-fpm from nginx is a little bit to much imo. if possible you also should not have to build your own image first. it should run with providing env vars and a separate mysql db. im working on a alpine version for a customer right now. im checking the official wordpress image for some ideas to get this work.

@cusspvz
Copy link

cusspvz commented Jan 2, 2016

We already bootstraped an alpine based docker image with s6 as supervisor. Unfortunately I dont have 100% sure if it has been completed since it wasn't implemented yet. Tomorrow, as soon as I get on my laptop I could confirm and release an OS one.

Enviado do meu telefone com Cyanogen

Em 02/01/2016 18:47, Mike notifications@github.com escreveu:

separate php-fpm from nginx is a little bit to much imo. if possible you also should not have to build your own image first. it should run with providing env vars and a separate mysql db. im working on a alpine version for a customer right now. im checking the official wordpress image for some ideas to get this work.


Reply to this email directly or view it on GitHub.

@MikeMichel
Copy link

checking this image it seems it's already pretty close to the wordpress one so changing it to
FROM php:5.6-apache and starting it with apache2-foreground gives you a pure piwik. imo the official image should just do it's job and be simple as possible to start. let the backup, ssh and other stuff be done by forks.

MikeMichel@9385a2b

@pierreozoux
Copy link
Collaborator Author

@MikeMichel thanks for the feedback.
This image is already the simplest, it just serves the php.
And there is not ssh, where did you see that?
The Backup is just a tip for people who might want backup, but everybody is free to use it or not.

@MikeMichel
Copy link

saw ssh in another piwik image but i just wanted to say, that keeping the official images as clean as possible should be the way to go. however, in this case it is just about the prefered webserver which is here nginx so you create another container for fpm to avoid s3/supervisord while here i would pick apache as it is part of the official php repo .with the mentioned to small changes i now can do

db:
  image: mysql
  volumes:
    - /volume/mysql/:/var/lib/mysql
  environment:
    - MYSQL_ROOT_PASSWORD=rootpassword
    - MYSQL_USER=mysqluser
    - MYSQL_PASSWORD=password
    - MYSQL_DATABASE=piwik
web:
  image: mikemichel/piwik-apache
  links:
    - db
  volumes:
    - /volume/web:/var/www/html/
  ports:
    - 80:80

and i'm ready to go but that's just the way i would prefer. there are many ways to do it.

@pierreozoux
Copy link
Collaborator Author

Ok the official image is almost merged \o/
Then I'll make a blog post.

And then, we'll make it with apache and alpine.

As other pojects like ownCloud or WordPress, they offer different alternatives with the use of tags. We can have the same.
Once it is official image, I'll prepare the repo to have 3 different tags, and I'll ask you @MikeMichel and @cusspvz to PR for apache and alpine.

How do you like the idea?

@MikeMichel
Copy link

ah right, tags make sense. i can do a blogpost then on sloppy.io how to combine wordpress with piwik using official images only.

@pierreozoux
Copy link
Collaborator Author

Ah you work for sloppy.io :)
Nice :)

Yes, it would be awesome!

On 09-01-2016 10:40, Mike wrote:

ah right, tags make sense. i can do a blogpost then on sloppy.io how to combine wordpress with piwik using official images only.


Reply to this email directly or view it on GitHub:
#1 (comment)

I use PGP to protect our privacy, if you want to know more, you can
follow this
https://emailselfdefense.fsf.org/en/

If you have further questions, please do not hesitate to ask.
You can verify my public key here: https://keybase.io/pierreozoux

@Toub
Copy link

Toub commented Jan 19, 2016

Hi guys,

Interesting discussion.
Any update about official images deployment?

@pierreozoux
Copy link
Collaborator Author

@Toub getting closer every days :)
docker-library/official-images#1203 (comment)

@pierreozoux
Copy link
Collaborator Author

The official repo is PRed, so I close this issue.

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

7 participants