{"id":127543,"date":"2022-08-25T10:53:03","date_gmt":"2022-08-25T10:53:03","guid":{"rendered":"https:\/\/blog.finxter.com\/?p=611841"},"modified":"2022-08-25T10:53:03","modified_gmt":"2022-08-25T10:53:03","slug":"how-to-install-the-solidity-compiler-via-docker-on-ubuntu","status":"publish","type":"post","link":"https:\/\/sickgaming.net\/blog\/2022\/08\/25\/how-to-install-the-solidity-compiler-via-docker-on-ubuntu\/","title":{"rendered":"How to Install the Solidity Compiler via Docker on Ubuntu?"},"content":{"rendered":"\n<div class=\"kk-star-ratings kksr-auto kksr-align-left kksr-valign-top\" data-payload=\"{&quot;align&quot;:&quot;left&quot;,&quot;id&quot;:&quot;611841&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;top&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;1&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;5&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;Rate this post&quot;,&quot;legend&quot;:&quot;5\\\/5 - (1 vote)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;width&quot;:&quot;142.5&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}\">\n<div class=\"kksr-stars\">\n<div class=\"kksr-stars-inactive\">\n<div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div class=\"kksr-stars-active\" style=\"width: 142.5px;\">\n<div class=\"kksr-star\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/div>\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\"> 5\/5 &#8211; (1 vote) <\/div>\n<\/div>\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube\"><a href=\"https:\/\/blog.finxter.com\/how-to-install-the-solidity-compiler-via-docker-on-ubuntu\/\"><img decoding=\"async\" src=\"https:\/\/blog.finxter.com\/wp-content\/plugins\/wp-youtube-lyte\/lyteCache.php?origThumbUrl=https%3A%2F%2Fi.ytimg.com%2Fvi%2FjT9DK2kmoEQ%2Fhqdefault.jpg\" alt=\"YouTube Video\"><\/a><figcaption><\/figcaption><\/figure>\n<div class=\"wp-block-file\"><object class=\"wp-block-file__embed\" data=\"https:\/\/blog.finxter.com\/wp-content\/uploads\/2022\/08\/Solidity-Blog-Finxter-Compiler-Docker.pdf\" type=\"application\/pdf\" style=\"width:100%;height:600px\" aria-label=\"Embed of Solidity-Blog-Finxter-Compiler-Docker.\"><\/object><a id=\"wp-block-file--media-fbab0f45-d7f4-459d-b8f2-41c3b8a2109b\" href=\"https:\/\/blog.finxter.com\/wp-content\/uploads\/2022\/08\/Solidity-Blog-Finxter-Compiler-Docker.pdf\">Solidity-Blog-Finxter-Compiler-Docker<\/a><a href=\"https:\/\/blog.finxter.com\/wp-content\/uploads\/2022\/08\/Solidity-Blog-Finxter-Compiler-Docker.pdf\" class=\"wp-block-file__button\" download aria-describedby=\"wp-block-file--media-fbab0f45-d7f4-459d-b8f2-41c3b8a2109b\">Download<\/a><\/div>\n<p>In this article, we continue building on our previous topic, the Solidity compiler installation:<\/p>\n<p class=\"has-base-background-color has-background\"><img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f30d.png\" alt=\"\ud83c\udf0d\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/> <strong>Previous Topic<\/strong>: <a href=\"https:\/\/blog.finxter.com\/how-to-install-the-solidity-compiler-with-npm\/\" data-type=\"post\" data-id=\"606118\">Solidity Compiler Installation (NPM)<\/a><\/p>\n<p>The previous article was focused on an installation via <em>npm<\/em>, and in this article, we\u2019ll go through the installation and use of the Solidity compiler via <em>Docker<\/em>. <\/p>\n<p>Our goal is to get more familiar with the possibilities of this approach, as well as to get introduced to the technology that \u201cruns the show\u201d. This knowledge and experience will enable us to recognize the reasons behind choosing any of the approaches in the future, depending on the real-world needs of our projects.<\/p>\n<h2>What is Docker?<\/h2>\n<p>Before we go into details about the Docker installation of <code>solc<\/code>, let\u2019s first get introduced to what Docker is. <\/p>\n<p class=\"has-global-color-8-background-color has-background\"><img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f4a1.png\" alt=\"\ud83d\udca1\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/> <em><strong>Docker<\/strong> is an open platform for developing, shipping, and running applications\u2026 Docker provides the ability to package and run an application in a loosely isolated environment called a container&#8230; Containers are lightweight and contain everything needed to run the application, so you do not need to rely on what is currently installed on the host.<\/em><\/p>\n<p><strong>Source<\/strong>: <a rel=\"noreferrer noopener\" href=\"https:\/\/docs.docker.com\/get-started\/overview\/\" target=\"_blank\"><em>https:\/\/docs.docker.com\/get-started\/overview\/<\/em><\/a><\/p>\n<p>There are some parts of the description I\u2019ve deliberately left out (separated by the symbol \u2026) because they\u2019re not essential to our understanding of the technology. <\/p>\n<p>Now, let\u2019s dissect the Docker description: the keywords of our interest are <em><strong>platform<\/strong><\/em>,<em> <strong>isolated environment<\/strong><\/em>, and <em><strong>container<\/strong><\/em>. Let&#8217;s quickly dive into each of those next<\/p>\n<h3>Platform<\/h3>\n<p>A <strong>platform<\/strong> is a software framework that supports a specific function or a goal. <\/p>\n<p>The goal Docker supports is enabling a piece of software (application, service, etc.) to correctly run, regardless of the target environment. <\/p>\n<p>For us, this means running the Solidity compiler, i.e. feeding it with the input source code and producing the output bytecode in the form of <code>.abi<\/code> and <code>.bin<\/code> files.<\/p>\n<h3>Isolated Environment<\/h3>\n<p>By mentioning an <strong>isolated environment<\/strong>, we remember the concept of virtualization learned about earlier, meaning that Docker enables our software to run as intended by providing it with the resources in form of software libraries, network access, remote services, and other dependencies.<\/p>\n<h3>Container<\/h3>\n<p>Docker ensures the resources are provided without additional intervention by arranging them in a package called a <strong>container<\/strong>. Containers begin their lifecycle as images that we most commonly download and run. <\/p>\n<p>We can also create a Docker image, but that\u2019s another story. <\/p>\n<p>Running an image creates a live instance of it, a container. Before it can be used, a Docker image has to be prepared, meaning that someone should install and configure all the required resources needed for the software to run. <\/p>\n<p>Preparation of a Docker image falls in the domain of <em><a rel=\"noreferrer noopener\" href=\"https:\/\/blog.finxter.com\/devops-specialist-income-and-opportunity\/\" data-type=\"post\" data-id=\"310928\" target=\"_blank\">DevOps<\/a><\/em>, i.e. Development and Operations: <\/p>\n<p class=\"has-global-color-8-background-color has-background\"><img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f4a1.png\" alt=\"\ud83d\udca1\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/> <em>\u201cDevOps engineers manage the operations of software development, implementing engineering tools and knowledge of the software development process to streamline software updates and creation.\u201d <\/em><\/p>\n<p><strong>Source<\/strong>: <a href=\"https:\/\/www.indeed.com\/hire\/c\/info\/devops-engineer\"><em>https:\/\/www.indeed.com\/hire\/c\/info\/devops-engineer<\/em><\/a><\/p>\n<p>Also, read our article:<\/p>\n<p class=\"has-base-background-color has-background\"><img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f30d.png\" alt=\"\ud83c\udf0d\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/> <strong>Recommended Article<\/strong>: <a href=\"https:\/\/blog.finxter.com\/top-20-skills-of-a-devops-engineer\/\" data-type=\"URL\" data-id=\"https:\/\/blog.finxter.com\/top-20-skills-of-a-devops-engineer\/\" target=\"_blank\" rel=\"noreferrer noopener\">Top 20 Skills Every DevOps Engineer Ought to Have<\/a><\/p>\n<h2>Using Solidity Compiler via Docker<\/h2>\n<p>Now that we have introduced Docker in general, we are continuing with the installation of the Solidity compiler via Docker.<\/p>\n<p>First, we have to check if Docker is present on our system by simultaneously checking the Docker version:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ docker version\nbash: \/usr\/bin\/docker: No such file or directory<\/pre>\n<p>As our check shows, we have to install Docker on our system before we can use it. The installation process via the Ubuntu repository is made of several steps (<a href=\"https:\/\/docs.docker.com\/engine\/install\/ubuntu\/\" target=\"_blank\" rel=\"noreferrer noopener\"><em>https:\/\/docs.docker.com\/engine\/install\/ubuntu\/<\/em><\/a>):<\/p>\n<h3>Step 1: Update the apt package index<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"1\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ sudo apt update\n\u2026\nReading package lists... Done\nBuilding dependency tree Reading state information... Done\nAll packages are up to date.<\/pre>\n<h3>Step 2: Install packages<\/h3>\n<p>Installation of additional packages; we need these packages to enable the installation process accessing the repository over the secure HTTPS connection (note the backslash symbol <code>\\<\/code> for the multiline command):<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"1\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ sudo apt install \\\nca-certificates \\\ncurl gnupg lsb-release\n...\nThe following additional packages will be installed: gnupg-l10n gnupg-utils gpg-wks-server\nSuggested packages: parcimonie xloadimage\nThe following NEW packages will be installed: ca-certificates curl gnupg gnupg-l10n gnupg-utils gpg-wks-server lsb-release\n...\nDo you want to continue? [Y\/n] y\n...\n<\/pre>\n<h3>Step 3: Add Docker GPG key<\/h3>\n<p>Adding the Docker\u2019s official GPG key:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ sudo mkdir \\\n-p \/etc\/apt\/keyrings\n$ curl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg \\\n| sudo gpg &#8211; dearmor -o \/etc\/apt\/keyrings\/docker.gpg\n<\/pre>\n<p class=\"has-global-color-8-background-color has-background\"><img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/2139.png\" alt=\"\u2139\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/> <strong>Info<\/strong>:<em> \u201cGPG, or GNU Privacy Guard, is a public key cryptography implementation. This allows for the secure transmission of information between parties and can be used to verify that the origin of a message is genuine.\u201d <\/em><\/p>\n<p><strong>Source<\/strong>: <a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-use-gpg-to-encrypt-and-sign-messages\"><em>https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-use-gpg-to-encrypt-and-sign-messages<\/em><\/a><\/p>\n<h3>Step 4: Set up repository<\/h3>\n<p>Setting up the repository by writing to <code>docker.list<\/code> file.<\/p>\n<p>The <code>echo<\/code> command evaluates the text inside the <code>$( )<\/code>, populates it with the command outputs (in parentheses), and sends it via stdin to system utility <code>sudo tee<\/code> with root privileges, which in turn overwrites the <code>docker.list<\/code> file and omits the output by redirecting it to <code>\/dev\/null<\/code>:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ echo \\ \"deb [arch=$(dpkg &#8211; print-architecture) \\\nsigned-by=\/etc\/apt\/keyrings\/docker.gpg] \\\nhttps:\/\/download.docker.com\/linux\/ubuntu \\\n$(lsb_release -cs) stable\" | sudo tee \\\n\/etc\/apt\/sources.list.d\/docker.list > \/dev\/null\n<\/pre>\n<p class=\"has-global-color-8-background-color has-background\"><img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/2139.png\" alt=\"\u2139\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/> <strong>Info<\/strong>: Repositories added by mistake can be removed from Ubuntu 20.04 by selectively deleting them in <code>\/etc\/apt\/sources.list.d\/<\/code> directory.<\/p>\n<h3>Step 5: Update apt package index<\/h3>\n<p>Updating the apt package index (once again):<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"1\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ sudo apt update\n...\nReading package lists... Done\nBuilding dependency tree Reading state information... Done\nAll packages are up to date.\n<\/pre>\n<h3>Step 6: Install Docker<\/h3>\n<p>Installing Docker (the latest stable version) and its components:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"1\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin\nReading package lists... Done\nBuilding dependency tree Reading state information... Done\nThe following additional packages will be installed: docker-ce-rootless-extras docker-scan-plugin pigz slirp4netns\nSuggested packages: aufs-tools cgroupfs-mount | cgroup-lite\nThe following NEW packages will be installed: containerd.io docker-ce docker-ce-cli docker-ce-rootless-extras docker-compose-plugin docker-scan-plugin pigz slirp4netns\n0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.\nNeed to get 108 MB of archives.\nAfter this operation, 449 MB of additional disk space will be used.\nDo you want to continue? [Y\/n] y\n...\n<\/pre>\n<p>Let\u2019s check the Docker version once again:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"1\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ docker version\nClient: Docker Engine - Community Version: 20.10.17 API version: 1.41 Go version: go1.17.11 Git commit: 100c701 Built: Mon Jun 6 23:02:57 2022 OS\/Arch: linux\/amd64 Context: default Experimental: true Server: Docker Engine - Community Engine: Version: 20.10.17 API version: 1.41 (minimum version 1.12) Go version: go1.17.11 Git commit: a89b842 Built: Mon Jun 6 23:01:03 2022 OS\/Arch: linux\/amd64 Experimental: false containerd: Version: 1.6.7 GitCommit: 0197261a30bf81f1ee8e6a4dd2dea0ef95d67ccb runc: Version: 1.1.3 GitCommit: v1.1.3-0-g6724737 docker-init: Version: 0.19.0 GitCommit: de40ad0\n<\/pre>\n<p>Now that we\u2019re sure that our Docker installation went through and the Docker Engine version we have is <code>20.20.17<\/code> (at the time of writing this article). The next step is getting the Docker image with the Solidity compiler.<\/p>\n<p>Docker images are identified by their <em>release organization<\/em>, <em>image name<\/em> (shorter, images), and <em>tag<\/em>, i.e. label that makes them unique. In general, we can download a Docker image by referencing it with its <code>organization\/image:tag<\/code> marker. <\/p>\n<p>We will download a Docker image of the Solidity compiler by specifying its marker as <code>ethereum\/solc:stable<\/code> for a stable version, and <code>ethereum\/solc:nightly<\/code> for the bleeding edge, potentially unstable version. <\/p>\n<p>We can also specify a distinct version of the Solidity compiler by setting a tag to a specific version, e.g. <code>ethereum\/solc:0.5.4<\/code>.<\/p>\n<p>We will do three things with one Docker command: we\u2019ll download the image, instantiate (run) a container from the image and print the container usage (flag &#8211; help):<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">docker run ethereum\/solc:stable &#8211; help<\/pre>\n<p>Sure enough, we\u2019d like to compile our Solidity files, so we\u2019ll make three preparations (<strong>First<\/strong>, <strong>Second<\/strong>, <strong>Third<\/strong>):<\/p>\n<p><strong>First<\/strong>: Create a local directory containing our <a href=\"https:\/\/blog.finxter.com\/solidity\/\" data-type=\"URL\" data-id=\"https:\/\/blog.finxter.com\/solidity\/\" target=\"_blank\" rel=\"noreferrer noopener\">Solidity<\/a> source code (I\u2019ll use <code>1_Storage.sol<\/code> from the <a href=\"https:\/\/blog.finxter.com\/smart-contracts-and-evm\/\" data-type=\"post\" data-id=\"92507\" target=\"_blank\" rel=\"noreferrer noopener\">Remix contracts<\/a> folder by creating an empty <a href=\"https:\/\/blog.finxter.com\/layout-of-a-solidity-source-file\/\" data-type=\"post\" data-id=\"455693\">f<\/a><a href=\"https:\/\/blog.finxter.com\/layout-of-a-solidity-source-file\/\" data-type=\"post\" data-id=\"455693\" target=\"_blank\" rel=\"noreferrer noopener\">i<\/a><a href=\"https:\/\/blog.finxter.com\/layout-of-a-solidity-source-file\/\" data-type=\"post\" data-id=\"455693\">le<\/a> and pasting the content into it):<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ mkdir ~\/solidity_src\/ &amp;&amp; cd ~\/solidity_src\/\n$ touch 1_Storage.sol\n<\/pre>\n<p><strong>Second<\/strong>: You can write your own contract for testing purposes or just open the <code>1_Storage.sol<\/code> with your favorite <a href=\"https:\/\/blog.finxter.com\/how-to-edit-a-text-file-in-windows-powershell\/\" data-type=\"post\" data-id=\"236823\" target=\"_blank\" rel=\"noreferrer noopener\">text editor<\/a> and paste the contents from <code>1_Storage.sol<\/code> example in Remix.<\/p>\n<p><strong>Third<\/strong>: Run a Docker container (we already have the image so the download procedure will be skipped); command flag <code>-v<\/code> mounts our local <code>~\/solidity_src<\/code> directory to the container\u2019s path <code>\/sources<\/code>, path <code>ethereum\/solc:stable<\/code> selects the Docker image to run a container, command flag <code>-o<\/code> sets the output location for the compiled files, <code>--abi<\/code> and <code>--bin<\/code> activate the generation of both <code>.abi<\/code> and <code>.bin<\/code> files, and the path <code>\/sources\/1_Storage.sol<\/code> selects the source file for compilation:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ docker run -v ~\/solidity_src:\/sources ethereum\/solc:stable -o \/sources\/output &#8211; abi &#8211; bin \/sources\/1_Storage.sol\nCompiler run successful. Artifact(s) can be found in directory \"\/sources\/output\".\n<\/pre>\n<p>When checking our <code>solidity_src<\/code> directory, we\u2019ll discover a new directory output, created by the Solidity compiler, containing both <code>.abi<\/code> and <code>.bin<\/code> files.<\/p>\n<p>Docker also enables us to use the standard JSON interface, and it is a recommended approach when using the compiler with a toolchain. This interface doesn\u2019t require mounted directories if the JSON input is self-contained, in other words, all the code is already contained in the source files and there are no references to external, imported files:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">docker run ethereum\/solc:stable &#8211; standard-json &lt; input.json > output.json<\/pre>\n<p>Since we haven\u2019t done any examples using the JSON interface, we\u2019ll suspend this approach until a later time.<\/p>\n<h2><a><\/a>Conclusion<\/h2>\n<p>This article introduced us to a Solidity-supporting technology called Docker. <\/p>\n<p>Of course, our main focus is on an ecosystem consisting of <a href=\"https:\/\/blog.finxter.com\/introduction-to-smart-contracts-and-solidity\/\" data-type=\"post\" data-id=\"445145\" target=\"_blank\" rel=\"noreferrer noopener\">Solidity<\/a>, <a href=\"https:\/\/blog.finxter.com\/smart-contracts-and-evm\/\" data-type=\"post\" data-id=\"92507\" target=\"_blank\" rel=\"noreferrer noopener\">Ethereum<\/a>, <a href=\"https:\/\/blog.finxter.com\/how-much-does-a-blockchain-engineer-make\/\" data-type=\"post\" data-id=\"161686\" target=\"_blank\" rel=\"noreferrer noopener\">blockchain technology<\/a>, etc., but I recognized an opportunity of making a detour and walking us through the process of setting up and using the Solidity compiler via the Docker platform. Therefore, although initially unplanned, we\u2019re also gaining some <a href=\"https:\/\/blog.finxter.com\/top-20-skills-of-a-devops-engineer\/\" data-type=\"post\" data-id=\"332626\" target=\"_blank\" rel=\"noreferrer noopener\">DevOps skills<\/a>.<\/p>\n<p>In the first and only chapter (yeah, I\u2019m a bit surprised as well) we\u2019ve set the mining charges by getting to know what Docker is. Then we blew a big piece of rock away by discovering how to install Docker on Ubuntu Linux (and by extension, some other operating systems). I believe this article will prove useful and provide multiple tips and tricks in terms of setting your development environment for Solidity on Ubuntu Linux. Besides that and personally speaking, it was always useful to gain secondary knowledge whenever I learned a specific topic, and I\u2019m sure you\u2019ll have the same experience.<\/p>\n<p class=\"has-base-background-color has-background\"><img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f30d.png\" alt=\"\ud83c\udf0d\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/> <strong>Recommended Tutorial<\/strong>: <a href=\"https:\/\/blog.finxter.com\/solidity-crash-course\/\" data-type=\"post\" data-id=\"445146\" target=\"_blank\" rel=\"noreferrer noopener\">Solidity Crash Course<\/a> (by Matija)<\/p>\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n<h2><a href=\"https:\/\/academy.finxter.com\/university\/solidity-basics\/\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"https:\/\/academy.finxter.com\/university\/solidity-basics\/\">Learn Solidity Course<\/a><\/h2>\n<p>Solidity is the programming language of the future.<\/p>\n<p>It gives you the rare and sought-after superpower to program against the &#8220;Internet Computer&#8221;, i.e., against decentralized Blockchains such as <em>Ethereum<\/em>, <em>Binance Smart Chain<\/em>, <em>Ethereum Classic<\/em>, <em>Tron<\/em>, and <em>Avalanche <\/em> &#8211; to mention just a few Blockchain infrastructures that support Solidity.<\/p>\n<p>In particular, Solidity allows you to<em> create smart contracts<\/em>, i.e., pieces of code that automatically execute on specific conditions in a completely decentralized environment. For example, smart contracts empower you to create your own <em>decentralized autonomous organizations<\/em> (DAOs) that run on Blockchains without being subject to centralized control.<\/p>\n<p>NFTs, DeFi, DAOs, and Blockchain-based games are all based on smart contracts.<\/p>\n<p><a href=\"https:\/\/academy.finxter.com\/university\/solidity-basics\/\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"https:\/\/academy.finxter.com\/university\/solidity-basics\/\">This course<\/a> is a simple, low-friction introduction to creating your first smart contract using the Remix IDE on the Ethereum testnet &#8211; without fluff, significant upfront costs to purchase ETH, or unnecessary complexity.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/academy.finxter.com\/university\/solidity-basics\/\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.finxter.com\/wp-content\/uploads\/2021\/10\/image-121.png\" alt=\"\" class=\"wp-image-37299\" width=\"491\" height=\"287\" srcset=\"https:\/\/blog.finxter.com\/wp-content\/uploads\/2021\/10\/image-121.png 982w, https:\/\/blog.finxter.com\/wp-content\/uploads\/2021\/10\/image-121-300x175.png 300w, https:\/\/blog.finxter.com\/wp-content\/uploads\/2021\/10\/image-121-768x448.png 768w\" sizes=\"auto, (max-width: 491px) 100vw, 491px\" \/><\/a><\/figure>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>5\/5 &#8211; (1 vote) Solidity-Blog-Finxter-Compiler-DockerDownload In this article, we continue building on our previous topic, the Solidity compiler installation: Previous Topic: Solidity Compiler Installation (NPM) The previous article was focused on an installation via npm, and in this article, we\u2019ll go through the installation and use of the Solidity compiler via Docker. Our goal is [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[857],"tags":[73,468,528],"class_list":["post-127543","post","type-post","status-publish","format-standard","hentry","category-python-tut","tag-programming","tag-python","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts\/127543","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/comments?post=127543"}],"version-history":[{"count":0,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts\/127543\/revisions"}],"wp:attachment":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/media?parent=127543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/categories?post=127543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/tags?post=127543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}