-
Notifications
You must be signed in to change notification settings - Fork 60
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
Makefile additions for building and pushing custom images #327
Makefile additions for building and pushing custom images #327
Conversation
|
This PR adds the ability to create a custom Drupal image, push that image to a container registry, then pull that image in a production environment without having to make local or make starter first. It adds the following make commands:
And the following environment variables:
To test this we can create a local install to build and push our image by doing the following:
Once you have created your image, you can also test
This will give you a fresh install using your custom image as the Drupal container, without the need for a local codebase folder |
Forgot to mention that those environment variables are also now used in make build so it makes the image with the specified namespace, name, and tag. I also changed docker-compose.custom.yml to use the image instead of building in place. The idea is that you won't have a codebase folder on your production machine, and instead will build that image elsewhere and just pull it in production. |
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.
Both make push-image and make production work without errors. When viewing the site created from make production it is missing the taxonomy terms normally gotten from make run-islandora-migrations. It's also missing the Fits migration tag as well. Would you be able to put these in the make production function?
@aOelschlager I've updated it to be more in line with |
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.
I just pulled in the new changes and everything works now on production like it does for make starter. Thank you Josh!
Added new variables to give more flexibility with image name and tag, so there are new instructions in the comments below
Previously when runningmake build
it would create a custom Drupal image with the name "projectname_drupal". This PR adds a variable to sample.env to allow setting a URL and namespace to create an image that's ready to push to dockerhub, gitlab, etc.This also adds another make command calledmake push-image
to then push that new image to dockerhub, gitlab, etc. using the same URL & namespace.To test, change CUSTOM_DRUPAL_NAMESPACE in .env to be your dockerhub username, or your gitlab registry URL & namespace and runmake build
, thenmake push-image
.eg.CUSTOM_DRUPAL_NAMESPACE=dockerhub_username
CUSTOM_DRUPAL_NAMESPACE=gitlab_registry_url.com/namespace
Leaving the namespace as the default shouldn't cause any issues, but will name the image mynamespace/projectname_drupal andmake push-image
will not work with the default namespace because it just tries to push to a dockerhub namespace the user doesn't have access to.