Estimated reading time: 6 minutes ![Line Line](/uploads/1/2/6/6/126691217/976006485.jpg)
- Mac Command Line
- Mac Download Link Command Line Command
- Mac Command Line Cheat Sheet
- Mac Download Link Command Line Download
- Mac Terminal Commands
- Mac Terminal Commands Pdf
- Mac Command Line Install
Obtain a static download link. Over time, the AzCopy download link will point to new versions of AzCopy. If your script downloads AzCopy, the script might stop working if a newer version of AzCopy modifies features that your script depends upon. To avoid these issues, obtain a static (un-changing) link to the current version of AzCopy. MySQL Cluster Community Edition is available as a separate download. The reason for this change is so that MySQL Cluster can provide more frequent updates and support using the latest sources of MySQL Cluster Carrier Grade Edition. MySQL 8.0 is the most current GA release. Terminal (in your /Applications/Utilities folder) is the default gateway to that command line on a Mac. With it, instead of pointing and clicking, you type your commands and your Mac does your.
Docker Desktop for Mac is the Community version of Docker for Mac.You can download Docker Desktop for Mac from Docker Hub.
By downloading Docker Desktop, you agree to the terms of the Docker Software End User License Agreement and the Docker Data Processing Agreement.
What to know before you install
README FIRST for Docker Toolbox and Docker Machine users
If you are already running Docker on your machine, first readDocker Desktop for Mac vs. Docker Toolbox to understand theimpact of this installation on your existing setup, how to set your environmentfor Docker Desktop on Mac, and how the two products can coexist.
Relationship to Docker Machine: Installing Docker Desktop on Mac does not affect machines you created with Docker Machine. You have the option to copy containers and images from your local
default
machine (if one exists) to the Docker Desktop HyperKit VM. Whenyou are running Docker Desktop, you do not need Docker Machine nodes running locally (or anywhere else). With Docker Desktop, you have a new, nativevirtualization system running (HyperKit) which takes the place of theVirtualBox system. To learn more, see Docker Desktop for Mac vs. Docker Toolbox.System requirements
Your Mac must meet the following requirements to successfully install Docker Desktop:
- Mac hardware must be a 2010 or a newer model, with Intel’s hardware support for memory management unit (MMU) virtualization, including Extended Page Tables (EPT) and Unrestricted Mode. You can check to see if your machine has this support by running the following command in a terminal:
sysctl kern.hv_support
If your Mac supports the Hypervisor framework, the command printskern.hv_support: 1
. - macOS must be version 10.14 or newer. That is, Mojave or Catalina. We recommend upgrading to the latest version of macOS.If you experience any issues after upgrading your macOS to version 10.15, you must install the latest version of Docker Desktop to be compatible with this version of macOS.Note: Docker supports Docker Desktop on the most recent versions of macOS. Docker Desktop currently supports macOS Mojave and macOS Catalina.As new major versions of macOS are made generally available, Docker stops supporting the oldest version and support the newest version of macOS.
- At least 4 GB of RAM.
- VirtualBox prior to version 4.3.30 must not be installed as it is not compatible with Docker Desktop.
What’s included in the installer
The Docker Desktop installation includes Docker Engine, Docker CLI client, Docker Compose, Notary, Kubernetes, and Credential Helper.
Install and run Docker Desktop on Mac
- Double-click
Docker.dmg
to open the installer, then drag the Docker icon to the Applications folder. - Double-click
Docker.app
in the Applications folder to start Docker. (In the example below, the Applications folder is in “grid” view mode.)The Docker menu in the top status bar indicates that Docker Desktop is running, and accessible from a terminal.If you’ve just installed the app, Docker Desktop launches the onboarding tutorial. The tutorial includes a simple exercise to build an example Docker image, run it as a container, push and save the image to Docker Hub. - Click the Docker menu () to seePreferences and other options.
- Select About Docker to verify that you have the latest version.
Congratulations! You are now successfully running Docker Desktop.
If you would like to rerun the tutorial, go to the Docker Desktop menu and select Learn.
Uninstall Docker Desktop
To unistall Docker Desktop from your Mac:
- From the Docker menu, select Troubleshoot and then select Uninstall.
- Click Uninstall to confirm your selection.
Note: Uninstalling Docker Desktop will destroy Docker containers and images local to the machine and remove the files generated by the application.
Switch between Stable and Edge versions
Docker Desktop allows you to switch between Stable and Edge releases. However, you can only have one version of Docker Desktop installed at a time. Switching between Stable and Edge versions can destabilize your development environment, particularly in cases where you switch from a newer (Edge) channel to an older (Stable) channel.
For example, containers created with a newer Edge version of Docker Desktop maynot work after you switch back to Stable because they may have been createdusing Edge features that aren’t in Stable yet. Keep this in mind asyou create and work with Edge containers, perhaps in the spirit of a playgroundspace where you are prepared to troubleshoot or start over.
Experimental features are turned on by default on Edge releases. However, when you switch from a Stable to an Edge release, you must turn on the experimental features flag to access experimental features. From the Docker Desktop menu, click Preferences > Command Line and then turn on the Enable experimental features toggle. Click Apply & Restart for the changes to take effect.
To safely switch between Edge and Stable versions, ensure you save images and export the containers you need, then uninstall the current version before installing another. For more information, see the section Save and Restore data below.
Save and restore data
You can use the following procedure to save and restore images and container data. For example, if you want to switch between Edge and Stable, or to reset your VM disk:
- Use
docker save -o images.tar image1 [image2 ...]
to save any images you want to keep. See save in the Docker Engine command line reference. - Use
docker export -o myContainner1.tar container1
to export containers you want to keep. See export in the Docker Engine command line reference. - Uninstall the current version of Docker Desktop and install a different version (Stable or Edge), or reset your VM disk.
- Use
docker load -i images.tar
to reload previously saved images. See load in the Docker Engine. - Use
docker import -i myContainer1.tar
to create a filesystem image corresponding to the previously exported containers. See import in the Docker Engine.
For information on how to back up and restore data volumes, see Backup, restore, or migrate data volumes.
Where to go next
- Getting started provides an overview of Docker Desktop on Mac, basic Docker command examples, how to get help or give feedback, and links to other topics about Docker Desktop on Mac.
- Troubleshooting describes common problems, workarounds, howto run and submit diagnostics, and submit issues.
- FAQs provide answers to frequently asked questions.
- Release notes lists component updates, new features, andimprovements associated with Stable releases. For information about Edge releases, seeEdge release notes.
- Get started with Docker provides a general Docker tutorial.
The Azure Cosmos emulator provides a local environment that emulates the Azure Cosmos DB service for development purposes. Using the Azure Cosmos emulator, you can develop and test your application locally, without creating an Azure subscription or incurring any costs. When you're satisfied with how your application is working in the Azure Cosmos emulator, you can switch to using an Azure Cosmos account in the cloud. This article describes how to install and use the emulator on Windows, Linux, macOS, and Windows docker environments.
Download the emulator
To get started, download and install the latest version of Azure Cosmos emulator on your local computer. The emulator release notes article lists all the available versions and the feature updates that were made in each release.
![Line Line](/uploads/1/2/6/6/126691217/976006485.jpg)
You can develop applications using Azure Cosmos emulator with the SQL, Cassandra, MongoDB, Gremlin, and Table API accounts. Currently the data explorer in the emulator fully supports viewing SQL data only; the data created using MongoDB, Gremlin/Graph and Cassandra client applications it is not viewable at this time. To learn more, see how to connect to the emulator endpoint from different APIs.
How does the emulator work?
The Azure Cosmos emulator provides a high-fidelity emulation of the Azure Cosmos DB service. It supports equivalent functionality as the Azure Cosmos DB, which includes creating data, querying data, provisioning and scaling containers, and executing stored procedures and triggers. You can develop and test applications using the Azure Cosmos emulator, and deploy them to Azure at global scale by updating the Azure Cosmos DB connection endpoint.
While emulation of the Azure Cosmos DB service is faithful, the emulator's implementation is different than the service. For example, the emulator uses standard OS components such as the local file system for persistence, and the HTTPS protocol stack for connectivity. Functionality that relies on the Azure infrastructure like global replication, single-digit millisecond latency for reads/writes, and tunable consistency levels are not applicable when you use the emulator.
You can migrate data between the Azure Cosmos emulator and the Azure Cosmos DB service by using the Azure Cosmos DB Data Migration Tool.
Differences between the emulator and the cloud service
Because the Azure Cosmos emulator provides an emulated environment that runs on the local developer workstation, there are some differences in functionality between the emulator and an Azure Cosmos account in the cloud:
- Currently the Data Explorer pane in the emulator fully supports SQL API clients only. The Data Explorer view and operations for Azure Cosmos DB APIs such as MongoDB, Table, Graph, and Cassandra APIs are not fully supported.
- The emulator supports only a single fixed account and a well-known primary key. You can't regenerate key when using the Azure Cosmos emulator, however you can change the default key by using the command-line option.
- With the emulator, you can create an Azure Cosmos account in provisioned throughput mode only; currently it doesn't support serverless mode.
- The emulator is not a scalable service and it doesn't support a large number of containers. When using the Azure Cosmos emulator, by default, you can create up to 25 fixed size containers at 400 RU/s (only supported using Azure Cosmos DB SDKs), or 5 unlimited containers. For more information on how to change this value, see Set the PartitionCount value article.
- The emulator does not offer different Azure Cosmos DB consistency levels like the cloud service does.
- The emulator does not offer multi-region replication.
- Because the copy of your Azure Cosmos emulator might not always be up to date with the most recent changes in the Azure Cosmos DB service, you should always refer to the Azure Cosmos DB capacity planner to accurately estimate the throughput (RUs) needs of your application.
- The emulator supports a maximum ID property size of 254 characters.
Install the emulator
Before you install the emulator, make sure you have the following hardware and software requirements:
- Software requirements:
- Currently Windows Server 2012 R2, Windows Server 2016, 2019 or Windows 8, 10 host OS are supported. The host OS with Active Directory enabled is currently not supported.
- 64-bit operating system
- Minimum hardware requirements:
- 2-GB RAM
- 10-GB available hard disk space
- To install, configure, and run the Azure Cosmos emulator, you must have administrative privileges on the computer. The emulator will add a certificate and also set the firewall rules in order to run its services. Therefore admin rights are necessary for the emulator to be able to execute such operations.
Mac Command Line
To get started, download and install the latest version of Azure Cosmos emulator on your local computer. If you run into any issues when installing the emulator, see the emulator troubleshooting article to debug.
Depending upon your system requirements, you can run the emulator on Windows, Docker for Windows, Linux, or macOS as described in next sections of this article.
Check for emulator updates
Each version of emulator comes with a set of feature updates or bug fixes. To see the available versions, read the emulator release notes article.
After installation, if you have used the default settings, the data corresponding to the emulator is saved at %LOCALAPPDATA%CosmosDBEmulator location. You can configure a different location by using the optional data path settings; that is the
/DataPath=PREFERRED_LOCATION
as the command-line parameter. The data created in one version of the Azure Cosmos emulator is not guaranteed to be accessible when using a different version. If you need to persist your data for the long term, it is recommended that you store that data in an Azure Cosmos account, instead of the Azure Cosmos emulator.Use the emulator on Windows
The Azure Cosmos emulator is installed at
C:Program FilesAzure Cosmos DB Emulator
location by default. To start the Azure Cosmos emulator on Windows, select the Start button or press the Windows key. Begin typing Azure Cosmos Emulator, and select the emulator from the list of applications.When the emulator has started, you'll see an icon in the Windows taskbar notification area. It automatically opens the Azure Cosmos data explorer in your browser at this URL
https://localhost:8081/_explorer/index.html
URL.You can also start and stop the emulator from the command-line or PowerShell commands. For more information, see the command-line tool reference article.
The Azure Cosmos emulator by default runs on the local machine ('localhost') listening on port 8081. The address appears as
https://localhost:8081/_explorer/index.html
. If you close the explorer and would like to reopen it later, you can either open the URL in your browser or launch it from the Azure Cosmos emulator in the Windows Tray Icon as shown below.Use the emulator on Docker for Windows
You can run the Azure Cosmos emulator on the Windows Docker container. See the Docker Hub for the docker pull command and GitHub for the
Dockerfile
and more information. Currently the emulator does not work on Docker for Oracle Linux. Use the following instructions to run the emulator on Docker for Windows:- After you have Docker for Windows installed, switch to Windows containers by right-clicking the Docker icon on the toolbar and selecting Switch to Windows containers.
- Next, pull the emulator image from Docker Hub by running the following command from your favorite shell.
- To start the image, run the following commands depending on the command line or the PowerShell environment:Windows based Docker images might not be generally compatible with every Windows host OS. For instance, the default Azure Cosmos emulator image is only compatible with Windows 10 and Windows Server 2016. If you need an image that is compatible with Windows Server 2019, run the following command instead:The response looks similar to the following:NoteWhen executing the
docker run
command, if you see a port conflict error (that is if the specified port is already in use), pass a custom port by altering the port numbers. For example, you can change the '-p 8081:8081' parameter to '-p 443:8081' - Now use the emulator endpoint and primary key from the response and import the TLS/SSL certificate into your host. To import the TLS/SSL certificate, run the following steps from an admin command prompt:
- If you close the interactive shell after the emulator has started, it will shut down the emulator's container. To reopen the data explorer, navigate to the following URL in your browser. The emulator endpoint is provided in the response message shown above.
https://<emulator endpoint provided in response>/_explorer/index.html
Mac Download Link Command Line Command
If you have a .NET client application running on a Linux docker container and if you are running Azure Cosmos emulator on a host machine, use the instructions in the next section to import the certificate into the Linux docker container.
Regenerate the emulator certificates when running on a Docker container
When running the emulator in a Docker container, the certificates associated with the emulator are regenerated every time you stop and restart the respective container. Because of that you have to re-import the certificates after each container start. To work around this limitation, you can use a Docker compose file to bind the Docker container to a particular IP address and a container image.
For example, you can use the following configuration within the Docker compose file, make sure to format it per your requirement:
Use the emulator on Linux or macOS
Currently the Azure Cosmos emulator can only be run on Windows. If you are using Linux or macOS, you can run the emulator in a Windows virtual machine hosted in a hypervisor such as Parallels or VirtualBox.
Note
Every time you restart the Windows virtual machine that is hosted in a hypervisor, you have to reimport the certificate because the IP address of the virtual machine changes. Importing the certificate isn't required in case you have configured the virtual machine to preserve the IP address.
Use the following steps to use the emulator on Linux or macOS environments:
- Run the following command from the Windows virtual machine and make a note of the IPv4 address:
- Within your application, change the endpoint URL to use the IPv4 address returned by
ipconfig.exe
instead oflocalhost
. - From the Windows VM, launch the Azure Cosmos emulator from the command line using the following options. For details on the parameters supported by the command line, see the emulator command-line tool reference:
- Finally, you need to resolve the certificate trust process between the application running on the Linux or Mac environment and the emulator. You can use one of the following two options to resolve the certificate:
- Import the emulator TLS/SSL certificate into the Linux or Mac environment or
Option 1: Import the emulator TLS/SSL certificate
The following sections show how to import the emulator TLS/SSL certificate into Linux and macOS environments.
Linux environment
If you are working on Linux, .NET relays on OpenSSL to do the validation:
- Export the certificate in PFX format. The PFX option is available when choosing to export the private key.
- Copy that PFX file into your Linux environment.
- Convert the PFX file into a CRT file
- Copy the CRT file to the folder that contains custom certificates in your Linux distribution. Commonly on Debian distributions, it is located on
/usr/local/share/ca-certificates/
. - Update the TLS/SSL certificates, which will update the
/etc/ssl/certs/
folder.
macOS environment
Use the following steps if you are working on Mac:
- Export the certificate in PFX format. The PFX option is available when choosing to export the private key.
- Copy that PFX file into your Mac environment.
- Open the Keychain Access application and import the PFX file.
- Open the list of Certificates and identify the one with the name
localhost
. - Open the context menu for that particular item, select Get Item and under Trust > When using this certificate option, select Always Trust.
Option 2: Disable the SSL validation in the application
Disabling SSL validation is only recommended for development purposes and should not be done when running in a production environment. The following examples show how to disable SSL validation for .NET and Node.js applications.
For any application running in a framework compatible with .NET Standard 2.1 or later, we can leverage the
CosmosClientOptions.HttpClientFactory
:For any application running in a framework compatible with .NET Standard 2.0, we can leverage the
CosmosClientOptions.HttpClientFactory
:Mac Command Line Cheat Sheet
For Node.js applications, you can modify your
package.json
file to set the NODE_TLS_REJECT_UNAUTHORIZED
while starting the application:Enable access to emulator on a local network
Mac Download Link Command Line Download
If you have multiple machines using a single network, and if you set up the emulator on one machine and want to access it from other machine. In such case, you need to enable access to the emulator on a local network.
You can run the emulator on a local network. To enable network access, specify the
/AllowNetworkAccess
option at the command-line, which also requires that you specify /Key=key_string
or /KeyFile=file_name
. You can use /GenKeyFile=file_name
to generate a file with a random key upfront. Then you can pass that to /KeyFile=file_name
or /Key=contents_of_file
.To enable network access for the first time, the user should shut down the emulator and delete the emulator's data directory %LOCALAPPDATA%CosmosDBEmulator.
Mac Terminal Commands
Authenticate connections when using emulator
As with Azure Cosmos DB in the cloud, every request that you make against the Azure Cosmos emulator must be authenticated. The Azure Cosmos emulator supports only secure communication via TLS. The Azure Cosmos emulator supports a single fixed account and a well-known authentication key for primary key authentication. This account and key are the only credentials permitted for use with the Azure Cosmos Emulator. They are:
Note
The primary key supported by the Azure Cosmos emulator is intended for use only with the emulator. You cannot use your production Azure Cosmos DB account and key with the Azure Cosmos Emulator.
Note
If you have started the emulator with the /Key option, then use the generated key instead of the default key
C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw
. For more information about /Key option, see Command-line tool reference.Connect to different APIs with the emulator
SQL API
Once you have the Azure Cosmos emulator running on your desktop, you can use any supported Azure Cosmos DB SDK or the Azure Cosmos DB REST API to interact with the emulator. The Azure Cosmos emulator also includes a built-in data explorer that lets you create containers for SQL API or Azure Cosmos DB for Mongo DB API. By using the data explorer, you can view and edit items without writing any code.
Azure Cosmos DB's API for MongoDB
Once you have the Azure Cosmos emulator running on your desktop, you can use the Azure Cosmos DB's API for MongoDB to interact with the emulator. Start the emulator from command prompt as an administrator with '/EnableMongoDbEndpoint'. Then use the following connection string to connect to the MongoDB API account:
Table API
Once you have the Azure Cosmos emulator running on your desktop, you can use the Azure Cosmos DB Table API SDK to interact with the emulator. Start the emulator from command prompt as an administrator with '/EnableTableEndpoint'. Next run the following code to connect to the table API account:
Cassandra API
Start emulator from an administrator command prompt with '/EnableCassandraEndpoint'. Alternatively you can also set the environment variable
AZURE_COSMOS_EMULATOR_CASSANDRA_ENDPOINT=true
.- Run the following commands in a regular command prompt window:
- In the CQLSH shell, run the following commands to connect to the Cassandra endpoint:
Gremlin API
Start emulator from an administrator command promptwith '/EnableGremlinEndpoint'. Alternatively you can also set the environment variable
AZURE_COSMOS_EMULATOR_GREMLIN_ENDPOINT=true
- Install apache-tinkerpop-gremlin-console-3.3.4.
- From the emulator's data explorer create a database 'db1' and a collection 'coll1'; for the partition key, choose '/name'
- Run the following commands in a regular command prompt window:
- In the Gremlin shell, run the following commands to connect to the Gremlin endpoint:
Uninstall the local emulator
Mac Terminal Commands Pdf
Use the following steps to uninstall the emulator:
- Exit all the open instances of the local emulator by right-clicking the Azure Cosmos emulator icon on the system tray, and then select Exit. It may take a minute for all instances to exit.
- In the Windows search box, type Apps & features and select Apps & features (System settings) result.
- In the list of apps, scroll to the Azure Cosmos DB Emulator, select it, click Uninstall, then confirm and select Uninstall again.
Next steps
Mac Command Line Install
In this article, you've learned how to use the local emulator for free local development. You can now proceed to the next articles: