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

Dockerize #34

Merged
merged 3 commits into from
May 13, 2017
Merged

Dockerize #34

merged 3 commits into from
May 13, 2017

Conversation

Nevon
Copy link
Contributor

@Nevon Nevon commented May 12, 2017

I'm using this as part of my CI run, which relies heavily on Docker.

You can easily set up an automated build on Docker Cloud to automatically build and push new images by tagging commits.

Dockerfile Outdated

RUN python setup.py install

ENTRYPOINT ["gixy"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

If you add a .editorconfig to the root of the project, those kind of conventions can be automatically applied by the editor. 👍

@antonbormotov
Copy link

Are you going to host it in docker hub?

@Nevon
Copy link
Contributor Author

Nevon commented May 12, 2017

I am hosting my fork (https://hub.docker.com/r/nevon/gixy/builds/), just to test it out, but I would rather someone who has contributor status to this repository would host this in the docker hub, since I don't think I can set it up to automatically build on pushes to a repo that I don't own.

@buglloc
Copy link
Member

buglloc commented May 12, 2017

Why using of alpine base image is better than python:2.7 for example?

@Nevon
Copy link
Contributor Author

Nevon commented May 13, 2017

Honestly, it just didn't occur to me to search for a python image. When is searched for python alpine, I just found an image by some random guy, so instead I took a base alpine image and installed the distro's version of python.

I can rebase this image on top of python:2.7-alpine.

@buglloc buglloc merged commit 85d075e into yandex:master May 13, 2017
@Nevon Nevon deleted the docker branch May 13, 2017 10:03
@buglloc
Copy link
Member

buglloc commented May 13, 2017

Thanks!

I would rather someone who has contributor status to this repository would host this in the docker hub
I'll do this a bit later.

@buglloc
Copy link
Member

buglloc commented May 24, 2017

I would rather someone who has contributor status to this repository would host this in the docker hub

Done: https://hub.docker.com/r/yandex/gixy/

@Nevon
Copy link
Contributor Author

Nevon commented May 25, 2017

Thanks!

@alister
Copy link

alister commented May 26, 2017

Is it possible to get a couple of lines of docs for how to use the Docker image to test a configuration?

@Nevon
Copy link
Contributor Author

Nevon commented May 27, 2017

You just mount the configuration as a volume in the gixy container and give it the path to the config file as an argument. For example:

λ ~/ docker run --rm -v `pwd`/nginx.conf:/etc/nginx/nginx.conf yandex/gixy:latest /etc/nginx/nginx.conf
[nginx_parser]  WARNING File not found: /etc/nginx/conf/mime.types
[nginx_parser]  WARNING File not found: /etc/nginx/proxy.conf
[nginx_parser]  WARNING File not found: /etc/nginx/fastcgi.conf

==================== Results ===================
No issues found.

==================== Summary ===================
Total issues:
    Unspecified: 0
    Low: 0
    Medium: 0
    High: 0

In my case, I'm already using docker-compose in my CI pipeline, and in that case you can use volumes_from to mount the configuration from your nginx container to your gixy container:

version: '2'
services:
  nginx:
    image: nginx:alpine
    volumes:
      - /etc/nginx

  scanner:
    image: yandex/gixy:latest
    volumes_from:
      - nginx
    command: "/etc/nginx/nginx.conf"
    depends_on:
      - nginx

Then just docker-compose up -d nginx && docker-compose run --rm scanner

@jifeon
Copy link

jifeon commented Jun 1, 2017

I think it would be nice to put previous comment into readme.md. Otherwise users have to search for an image on dockerhub, or look for an issue in this repo.

@buglloc
Copy link
Member

buglloc commented Jun 1, 2017

You're right.
I'll write a some documentation about the Docker image usage on the next weekend.

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

Successfully merging this pull request may close these issues.

5 participants