---
# System prepended metadata

title: 樹莓派筆記-安裝 Portainer in docker
tags: [docker, Linux, 樹莓派]

---

---
title: 
description: 
date: 2023-04-16
lang: zh-tw
tags:
  - 樹莓派
  - Linux
  - docker
---

# 樹莓派筆記-安裝 Portainer in docker
用於管理 Docker 環境的 Web GUI

## docker-compose
`docker-compose.yml`
```yml=
version: '3.3'
networks:
  default:
    name: ${DOCKER_MY_NETWORK}
    external: true
services:
  portainer:
    image: 6053537/portainer-ce:latest
    container_name: portainer
    restart: unless-stopped
    ports:
      - 9000:9000
    volumes:
      #讀取Host主機時間
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./portainer:/data
    env_file: 
      - ./.env

```
## env
`.env`
```yml=
# common.env: Set development environment
DOCKER_MY_NETWORK=homelab
```
## Ref
* https://www.portainer.io/
* https://github.com/DoTheEvo/selfhosted-apps-docker/tree/master/portainer
* https://yeasy.gitbook.io/docker_practice/compose/compose_file
