Dockerfiles: finance/dev-tools: remove timezone mount

When running `finance` image's `import` command (but only when
container's hledger-flow coinbase/coinbase-pro accounts are imported),
the following error is given:

  ```
  IsADirectoryError: [Errno 21] Is a directory: '/etc/timezone'
  Selector name 'id' does not exist as a named header in the given CSV data.
  ```

specifically, after enabling verbose printing of `csvjoin` (which is only
used within these accounts), the following error is given:

  ```
  File "/home/user/.local/share/pipx/venvs/csvkit/lib/python3.12/site-packages/babel/localtime/_unix.py", line 57, in _get_localzone
    with open(tzpath, 'rb') as tzfile:
         ^^^^^^^^^^^^^^^^^^
  ```

where all errors prevent the successful import of applicable accounts.

The python error appears to have been introduced in csvkit 2.0.0 and
appears to be the result of an upstream decision (or bug) to not test
whether /etc/timezone is a directory or a file (Arch Linux treats
/etc/timezone as a directory).

Fortunately, docker-finance's mounting of /etc/localtime appears to
satisfy use-case requirements; so, /etc/timezone is no longer needed.

Removing /etc/timezone resolves all errors.
This commit is contained in:
2024-06-12 17:13:47 -07:00
parent 8f03cb0ef8
commit 958cf11be3
3 changed files with 0 additions and 3 deletions

View File

@@ -30,7 +30,6 @@ services:
- ${DOCKER_FINANCE_CLIENT_REPO}/docker-finance.dox:${DOCKER_FINANCE_CLIENT_REPO}/docker-finance.dox
- ${DOCKER_FINANCE_CLIENT_REPO}/client:${DOCKER_FINANCE_CLIENT_REPO}/client
- ${DOCKER_FINANCE_CLIENT_REPO}/container:${DOCKER_FINANCE_CLIENT_REPO}/container
#- /etc/timezone:/etc/timezone:ro # TODO: will break on Arch hosts
- /etc/localtime:/etc/localtime:ro
environment:
- DOCKER_FINANCE_CLIENT_REPO=${DOCKER_FINANCE_CLIENT_REPO}

View File

@@ -31,7 +31,6 @@ services:
- ${DOCKER_FINANCE_CLIENT_SHARED}:${DOCKER_FINANCE_CONTAINER_SHARED}
# Needed for when upstream data is localtime instead of UTC
# NOTE: although TZ can be used within the container, this *should* be more dynamic
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
environment:
- DOCKER_FINANCE_CONTAINER_CMD=${DOCKER_FINANCE_CONTAINER_CMD}

View File

@@ -31,7 +31,6 @@ services:
- ${DOCKER_FINANCE_CLIENT_SHARED}:${DOCKER_FINANCE_CONTAINER_SHARED}
# Needed for when upstream data is localtime instead of UTC
# NOTE: although TZ can be used within the container, this should be more dynamic
# TODO: for Ubuntu hosts/containers, mount /etc/timezone (not needed w/ Arch)
- /etc/localtime:/etc/localtime:ro
environment:
- DOCKER_FINANCE_CONTAINER_CMD=${DOCKER_FINANCE_CONTAINER_CMD}