Tutorial by Examples

LABEL <key>=<value> <key>=<value> <key>=<value> ... The LABEL instruction adds metadata to an image. A LABEL is a key-value pair. To include spaces within a LABEL value, use quotes and backslashes as you would in command-line parsing. A few usage examples: LAB...
The CMD instruction has three forms: CMD ["executable","param1","param2"] (exec form, this is the preferred form) CMD ["param1","param2"] (as default parameters to ENTRYPOINT) CMD command param1 param2 (shell form) There can only be one CMD ins...
MAINTAINER <name> The MAINTAINER instruction allows you to set the Author field of the generated images. DO NOT USE THE MAINTAINER DIRECTIVE According to Official Docker Documentation the MAINTAINER instruction is deprecated. Instead, one should use the LABEL instruction to define the aut...
FROM <image> Or FROM <image>:<tag> Or FROM <image>@<digest> The FROM instruction sets the Base Image for subsequent instructions. As such, a valid Dockerfile must have FROM as its first instruction. The image can be any valid image – it is especially easy to ...
RUN has 2 forms: RUN <command> (shell form, the command is run in a shell, which by default is /bin/sh -c on Linux or cmd /S /C on Windows) RUN ["executable", "param1", "param2"] (exec form) The RUN instruction will execute any commands in a new layer on top ...
ONBUILD [INSTRUCTION] The ONBUILD instruction adds to the image a trigger instruction to be executed at a later time, when the image is used as the base for another build. The trigger will be executed in the context of the downstream build, as if it had been inserted immediately after the FROM in...
STOPSIGNAL signal The STOPSIGNAL instruction sets the system call signal that will be sent to the container to exit. This signal can be a valid unsigned number that matches a position in the kernel’s syscall table, for instance 9, or a signal name in the format SIGNAME, for instance SIGKILL.
The HEALTHCHECK instruction has two forms: HEALTHCHECK [OPTIONS] CMD command (check container health by running a command inside the container) HEALTHCHECK NONE (disable any healthcheck inherited from the base image) The HEALTHCHECK instruction tells Docker how to test a container to check that...
SHELL ["executable", "parameters"] The SHELL instruction allows the default shell used for the shell form of commands to be overridden. The default shell on Linux is ["/bin/sh", "-c"], and on Windows is ["cmd", "/S", "/C"]. The...
Calculate a 6-month (126-business-day) centered moving average of a price: SELECT TradeDate, AVG(Px) OVER (ORDER BY TradeDate ROWS BETWEEN 63 PRECEDING AND 63 FOLLOWING) AS PxMovingAverage FROM HistoricalPrices Note that, because it will take up to 63 rows before and after each returned row, at...
Make sure your image object is fully loaded before you try to draw it on the canvas with context.drawImage. Otherwise the image will silently fail to display. In JavaScript, images are not loaded immediately. Instead, images are loaded asynchronously and during the time they take to load JavaScript...
SQL Server 2012 FETCH is generally more useful for pagination, but can be used as an alternative to TOP: SELECT * FROM table_name ORDER BY 1 OFFSET 0 ROWS FETCH NEXT 50 ROWS ONLY
When a runtime error occurs, good code should handle it. The best error handling strategy is to write code that checks for error conditions and simply avoids executing code that results in a runtime error. One key element in reducing runtime errors, is writing small procedures that do one thing. Th...
Even with guard clauses, one cannot realistically always account for all possible error conditions that could be raised in the body of a procedure. The On Error GoTo statement instructs VBA to jump to a line label and enter "error handling mode" whenever an unexpected error occurs at runti...
An error-handling subroutine will either: run to the end of the procedure, in which case execution resumes in the calling procedure. or, use the Resume keyword to resume execution inside the same procedure. The Resume keyword should only ever be used inside an error handling subroutine, becau...
Often when writing a specialized class, you'll want it to raise its own specific errors, and you'll want a clean way for user/calling code to handle these custom errors. A neat way to achieve this is by defining a dedicated Enum type: Option Explicit Public Enum FoobarError Err_FooWasNotBarre...
This script, from here and here, will return all Tables and Columns where a specified value exists. This is powerful in finding out where a certain value is in a database. It can be taxing, so it is suggested that it be executed in a backup / test enviroment first. DECLARE @SearchStr nvarchar(100) ...
SELECT ps.name AS PartitionScheme , fg.name AS [FileGroup] , prv.* , LAG(prv.Value) OVER (PARTITION BY ps.name ORDER BY ps.name, boundary_id) AS PreviousBoundaryValue FROM sys.partition_schemes ps INNER JOIN sys.destination_data...
According to this [TechNet Microsoft page][1], Partitioning data enables you to manage and access subsets of your data quickly and efficiently while maintaining the integrity of the entire data collection. When you call the following query the data is not physically moved; only the metadata ab...
Using the Authors table in the Library Database CREATE PROCEDURE GetName ( @input_id INT = NULL, --Input parameter, id of the person, NULL default @name VARCHAR(128) = NULL --Input parameter, name of the person, NULL default ) AS BEGIN SELECT Name + ' is from ' + Country...

Page 421 of 1336