Cannot dump database in Oracle on Docker
I was able to replicate the error.First login without username parameter into docker container(you'll logged in as root user)

C:\&gt;docker exec -it xedbd bash
bash-4.2# expdp system/oracle  dumpfile=test01.dmp directory=DATA_PUMP_DIR logfile=test.log

Export: Release 18.0.0.0.0 - Production on Mon Feb 17 21:22:19 2020
Version 18.4.0.0.0

Copyright (c) 1982, 2018, Oracle and/or its affiliates.  All rights reserved.

UDE-12547: operation generated ORACLE error 12547
ORA-12547: TNS:lost contact


I'll add user parameter and remember the schema is in pdb you need to add connect identifier in expdp

    C:\&gt;docker exec -it -u oracle xedbd bash
    [oracle@89feb4161c93 /]$ expdp system/oracle@xepdb1 dumpfile=test01.dmp directory=DATA_PUMP_DIR logfile=test.log schemas=test

    Export: Release 18.0.0.0.0 - Production on Mon Feb 17 21:24:12 2020
    Version 18.4.0.0.0

    Copyright (c) 1982, 2018, Oracle and/or its affiliates.  All rights reserved.

    Connected to: Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production
    Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01":  system/********@xepdb1 dumpfile=test01.dmp directory=DATA_PUMP_DIR logfile=test.log schemas=test
    Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
    Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
    Processing object type SCHEMA_EXPORT/STATISTICS/MARKER
    Processing object type SCHEMA_EXPORT/USER
    Processing object type SCHEMA_EXPORT/ROLE_GRANT
    Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
    Processing object type SCHEMA_EXPORT/TABLESPACE_QUOTA
    Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
    Processing object type SCHEMA_EXPORT/TABLE/TABLE
    . . exported "TEST"."T1"                                 9.978 MB   72834 rows
    Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
    ******************************************************************************
    Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is:
    /opt/oracle/admin/XE/dpdump/9ECC9107E3AE0AADE053020011AC6840/test01.dmp
    Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully completed at Mon Feb 17 21:24:53 
   2020 elapsed 0 00:00:39