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

Add support to independently version docker images #1166

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions img-versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"easyengine/mailhog": "v4.0.0-beta.5",
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

"easyengine/mariadb": "v4.0.0-beta.5",
"easyengine/nginx-proxy": "v4.0.0-beta.5",
"easyengine/nginx": "v4.0.0-beta.5",
"easyengine/php": "v4.0.0-beta.5",
"easyengine/phpmyadmin": "v4.0.0-beta.5",
"easyengine/postfix": "v4.0.0-beta.5",
"easyengine/redis": "v4.0.0-beta.5"
}
3 changes: 2 additions & 1 deletion php/site-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ function init_checks() {
EE::error( 'Cannot create/start proxy container. Please make sure port 80 and 443 are free.' );
} else {
$EE_CONF_ROOT = EE_CONF_ROOT;
$ee_proxy_command = "docker run --name $proxy_type -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_CONF_ROOT/nginx/certs:/etc/nginx/certs -v $EE_CONF_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_CONF_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_CONF_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_CONF_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_CONF_ROOT:/app/ee4 -v /usr/share/nginx/html easyengine/nginx-proxy:v" . EE_VERSION;
$img_versions = EE\Utils\get_image_versions();
$ee_proxy_command = "docker run --name $proxy_type -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_CONF_ROOT/nginx/certs:/etc/nginx/certs -v $EE_CONF_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_CONF_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_CONF_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_CONF_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_CONF_ROOT:/app/ee4 -v /usr/share/nginx/html easyengine/nginx-proxy:" . $img_versions['easyengine/nginx-proxy'];


if ( EE::docker()::boot_container( $proxy_type, $ee_proxy_command ) ) {
Expand Down
10 changes: 10 additions & 0 deletions php/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -1545,3 +1545,13 @@ function get_callable_name( callable $callable ) {
return 'unknown';
}
}

/**
* Function to get the docker image versions stored in img-versions.json file.
*
* @return array Docker image versions.
*/
function get_image_versions() {

return json_decode( file_get_contents( EE_ROOT . '/img-versions.json' ), true );
}