-
Notifications
You must be signed in to change notification settings - Fork 12
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
Build a docker image with greenframe-cli #19
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Dockerfile
Outdated
|
||
|
||
## Specific build with GCP tools | ||
FROM base as gcp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this part related to greenframe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gcloud
command line tools are required to use kubectl ...
commands in the Google Cloud Platform kubernetes execution context, especially for all authentication steps.
It's the same for Azure and AWS.
I think it would be great to offer all the necessary tools for the major cloud providers (GCP, AWS, Azure) and create a specific version of the greenframe-cli image.
I added a new make command (which can be used in the GitHub workflow) to build these images:
DOCKER_BUILDKIT=1 docker build -t greenframe-cli:latest -t greenframe-cli:$(PACKAGE_VERSION) . --target base
for the base image, and:
DOCKER_BUILDKIT=1 docker build -t greenframe-cli:$(PACKAGE_VERSION)-gcp . --target gcp
etc ...
for the specific cloud providers.
One greenframe-cli version will have these docker version:
- greenframe-cli:latest
- greenframe-cli:1.4.4
- greenframe-cli:1.4.4-gcp
- greenframe-cli:1.4.4-azure
- greenframe-cli:1.4.4-...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not something we want to maintain in this repository. I prefer that we provide a cloud-agnostic base image, and leave to the community the cloud-specific images.
Awesome! Your PR is in Draft, what's left to finish it? |
I just pushed a new commit with
|
@fzaninotto |
Hello Vincent, I've checked out locally and tried to run a greenframe analyze using the provided Dockerfile: # from project root
docker build -t greenframe-docker-in-docker-test .
docker run -v $(pwd)/:/app greenframe-docker-in-docker-test analyze -C ./.greenframe.e2e.yml I'm getting an error about being unable to connect to the Docker daemon:
I thought this was dind based but now realize it might be dood (Docker outside of Docker), do we have to map the docker sock from host to container for it to work? If yes, we need to document it, and we could use an alpine based image so that the final image is lighter, I worked on a dood alpine image so it might come handy. |
Hello. First of all I would like to thank you for this project. Juste my 2 cents here. We have created a small and simple Docker image in order to run greenframe-cli : https://github.com/acseo/docker-greenframe-cli You cans use it to test a remote or a local website : $ docker run -it -v /var/run/docker.sock:/var/run/docker.sock acseo/greenframe-cli \
greenframe analyze https://www.acseo.fr $ docker run -it \
-e "DEBUG=*" \
--network="host" \
-v $(pwd)/greeframe.yml:/app/greenframe.yml \
-v $(pwd)/scenario.js:/app/scenario.js \
-v /var/run/docker.sock:/var/run/docker.sock \
acseo/greenframe-cli greenframe analyze -C /app/greenframe.yml http://my-app.local /app/greenframe.js Maybe it will be useful for someone 😃 |
Closes #18