github.com/amazechain/amc@v0.1.3/docs/installation/docker.md (about)

     1  # Docker
     2  
     3  There are two ways to obtain a AMCDocker image:
     4  
     5  1. [GitHub](#github)
     6  2. [Building it from source](#building-the-docker-image)
     7  
     8  Once you have obtained the Docker image, proceed to [Using the Docker
     9  image](#using-the-docker-image).
    10  
    11  > **Note**
    12  >
    13  > AMCrequires Docker Engine version 20.10.10 or higher due to [missing support](https://docs.docker.com/engine/release-notes/20.10/#201010) for the `clone3` syscall in previous versions.
    14  ## GitHub
    15  
    16  amc docker images for both x86_64 and ARM64 machines are published with every release of amc on GitHub Container Registry.
    17  
    18  You can obtain the latest image with:
    19  
    20  ```bash
    21  docker pull amazechain/amc
    22  ```
    23  
    24  Or a specific version (e.g. v0.1.0) with:
    25  
    26  ```bash
    27  docker pull amazechain/amc:0.1.0
    28  ```
    29  
    30  You can test the image with:
    31  
    32  ```bash
    33  docker run --rm amazechain/amc:0.1.0-amd64
    34  ```
    35  
    36  If you see the latest amc release version, then you've successfully installed amc via Docker.
    37  
    38  ## Building the Docker image
    39  
    40  To build the image from source, navigate to the root of the repository and run:
    41  
    42  ```bash
    43  make images
    44  ```
    45  
    46  The build will likely take several minutes. Once it's built, test it with:
    47  
    48  ```bash
    49  docker run amazechain/amc:local --version
    50  ```
    51  
    52  ## Using the Docker image
    53  
    54  There are two ways to use the Docker image:
    55  1. [Using Docker](#using-plain-docker)
    56  2. [Using Docker Compose](#using-docker-compose)
    57  
    58  ### Using Plain Docker
    59  
    60  To run amc with Docker, execute:
    61  
    62  ```
    63  docker run -p 6060:6060 -p 61016: 61016 -p 61015: 61015/udp -v amcdata:/home/amc/data amazechain/amc:local --metrics --metrics.addr '0.0.0.0' 
    64  ```
    65  
    66  The above command will create a container named amc and a named volume called amcdata for data persistence. It will also expose port 61016 TCP and 61015 UDP for peering with other nodes and port 6060 for metrics.
    67  
    68  It will use the local image amc:local. If you want to use the DockerHub Container Registry remote image, use amazechain/amc with your preferred tag.
    69  
    70  ### Using Docker Compose
    71  
    72  To run amc with Docker Compose, execute the following commands from a shell inside the root directory of this repository:
    73  
    74  ```bash
    75  docker-compose -f docker-compose.yml up -d 
    76  # or make up
    77  ```
    78  
    79  The default `docker-compose.yml` file will create three containers:
    80  
    81  - amc
    82  - Prometheus
    83  - Grafana
    84  
    85  
    86  Grafana will be exposed on `localhost:3000` and accessible via default credentials (username and password is `admin`):
    87  
    88  ## Interacting with amc inside Docker
    89  
    90  To interact with amc, you must first open a shell inside the amc container by running:
    91  
    92  ```bash
    93  docker exec -it amc sh
    94  ```
    95  
    96  **If amc is running with Docker Compose, replace amc with amc-amc-1 in the above command.**
    97  
    98  Inside the amc container, refer to the [CLI docs](../cli/cli.md) documentation to interact with amc.