set global sql mode but showing a different mode I have this command to run in my docker file

mysql -e "SET GLOBAL sql_mode = 'STRICT_ALL_TABLES';"

But when i check the mysql mode it shows as

mysql&gt; select @@sql_mode;
+------------------------+
| @@sql_mode             |
+------------------------+
| NO_ENGINE_SUBSTITUTION |
+------------------------+
1 row in set (0.01 sec)


Does anyone has any experience with this ?
Your problem is quite simple.
When you change the value of a global variable, the current session still retains the session value.
To prove that, please run this
SELECT * FROM information_schema.global_variables
WHERE variable_name='sql_mode'
UNION SELECT * FROM information_schema.session_variables
WHERE variable_name='sql_mode';

You should get this output if the global and session values are the same
+---------------+------------------------+
| VARIABLE_NAME | VARIABLE_VALUE         |
+---------------+------------------------+
| SQL_MODE      | NO_ENGINE_SUBSTITUTION |
+---------------+------------------------+

You should get this output if the global and session values are different
+---------------+------------------------+
| VARIABLE_NAME | VARIABLE_VALUE         |
+---------------+------------------------+
| SQL_MODE      | STRICT_ALL_TABLES      |
| SQL_MODE      | NO_ENGINE_SUBSTITUTION |
+---------------+------------------------+

To see that change, you must logout and login. Then, run the UNION query.
If you cannot logout of the current session, you must run
SET SESSION sql_mode = 'STRICT_ALL_TABLES';

to see the difference.
GIVE IT A TRY !!!
UPDATE 2015-09-03 18:14 EDT
You just asked me

Why doesnt it has the STRICT_ALL_TABLES in the global session though ?

Guess what ?? @@sql_mode is not global. It's session.
Let me run this query for the difference:
mysql&gt; select @@global.sql_mode,@@session.sql_mode,@@sql_mode;
+-------------------+------------------------+------------------------+
| @@global.sql_mode | @@session.sql_mode     | @@sql_mode             |
+-------------------+------------------------+------------------------+
| STRICT_ALL_TABLES | NO_ENGINE_SUBSTITUTION | NO_ENGINE_SUBSTITUTION |
+-------------------+------------------------+------------------------+
1 row in set (0.00 sec)

Therefore, if you want global, you must use @@global.. Otherwise, it's session.