Tutorial by Examples: c

Data-only containers are obsolete and are now considered an anti-pattern! In the days of yore, before Docker's volume subcommand, and before it was possible to create named volumes, Docker deleted volumes when there were no more references to them in any containers. Data-only containers are obsolet...
docker run -d --name "mysql-1" -v "/var/lib/mysql" mysql This command creates a new container from the mysql image. It also creates a new data volume, which it then mounts in the container at /var/lib/mysql. This volume helps any data inside of it persist beyond the lifetime o...
Many interesting operations in common JavaScript programming environments are asynchronous. For example, in the browser we see things like window.setTimeout(() => { console.log("this happens later"); }, 100); and in Node.js we see things like fs.readFile("file.txt", (...
docker-compose.yml version: '2' services: php: image: phpmyadmin/phpmyadmin links: - mysql:db depends_on: - mysql mysql: image: k0st/alpine-mariadb volumes: - ./data/mysql:/var/lib/mysql environment: - MYSQL_DATABASE=mydb ...
Used by awk to split the input into multiple records. For example: echo "a b c|d e f" | awk 'BEGIN {RS="|"} {print $0}' produces: a b c d e f By default, the record separator is the newline character. Similarly: echo "a b c|d e f" | awk 'BEGIN {RS="|&quo...
docker volume create --name="myAwesomeApp" Using a named volume makes managing volumes much more human-readable. It is possible to create a named volume using the command specified above, but it's also possible to create a named volume inside of a docker run command using the -v or --vo...
An Akka MessageDispatcher is what makes Akka Actors "tick", it is the engine of the machine so to speak. All MessageDispatcher implementations are also an ExecutionContext, which means that they can be used to execute arbitrary code, for instance Futures. Every ActorSystem will have a def...
So in case you want to give your Actor a different dispatcher than the default, you need to do two things, of which the first is to configure the dispatcher in your application.conf: my-dispatcher { # Dispatcher is the name of the event-based dispatcher type = Dispatcher # What kind of Exe...
Using docker-machine is the best method to install Docker on a machine. It will automatically apply the best security settings available, including generating a unique pair of SSL certificates for mutual authentication and SSH keys. To create a local machine using Virtualbox: docker-machine create...
Listing docker-machines will return the state, address and version of Docker of each docker machines. docker-machine ls Will print something like: NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS docker-machine-1 - ovh Running ...
Upgrading a docker machine implies a downtime and may require planing. To upgrade a docker machine, run: docker-machine upgrade docker-machine-name This command does not have options
In Common Lisp, if is the simplest conditional construct. It has the form (if test then [else]) and is evaluated to then if test is true and else otherwise. The else part can be omitted. (if (> 3 2) "Three is bigger!" "Two is bigger!") ;;=> "Three is bigger...
docker save -o ubuntu.latest.tar ubuntu:latest This command will save the ubuntu:latest image as a tarball archive in the current directory with the name ubuntu.latest.tar. This tarball archive can then be moved to another host, for example using rsync, or archived in storage. Once the tarball h...
While attached to a running container with a pty assigned (docker run -it ...), you can press ControlP - ControlQ to detach.
Use the lazy_static crate to create global immutable variables which are initialized at runtime. We use HashMap as a demonstration. In Cargo.toml: [dependencies] lazy_static = "0.1.*" In main.rs: #[macro_use] extern crate lazy_static; lazy_static! { static ref HASHMAP: Hash...
Docker is just a fancy way to run a process, not a virtual machine. Therefore, debugging a process "in a container" is also possible "on the host" by simply examining the running container process as a user with the appropriate permissions to inspect those processes on the host (...
Mobile platforms like iOS automatically recognize phone numbers and turn them into tel: links. While the feature is very practical, the system sometimes detects ISBN codes and other numbers as telephone numbers. For mobile Safari and some other WebKit-based mobile browsers to turn off automatic pho...
docker-compose run service-name command If, for example, you wanted to run rake db:create in your web service, you'd use the following command: docker-compose run web rake db:create
Install Docker Engine. If you get a Permission denied error, Run sudo -i before the two commands below, then exit. Pull Docker Compose to /usr/local/bin/docker-compose. curl -L https://github.com/docker/compose/releases/download/1.7.1/docker-compose-`uname -s`-`uname -m` > /usr/loc...
With benchmark tests you can test and measure the speed of the code, however benchmark tests are still unstable. To enable benchmarks in your cargo project you need nightly rust, put your integration benchmark tests to the benches/ folder in the root of your Cargo project, and run cargo bench. Exam...

Page 262 of 826