Bumping an ancient thread because I was also having trouble automatically importing channels into a docker container.
My solution was to leverage the API using wget and curl.
Be sure to declare a name for the mirth connect container when running docker:
sudo docker run -d --name mirth-container-name -p 8443:8443 -p 6661:6661 nextgenhealthcare/connect
Then use wget to pull the channel xml to a temp folder in the docker container:
sudo docker exec mirth-container-name wget -q –auth-no-challenge –header='Accept:application/octet-stream' "https://raw.githubusercontent.com/marlycormar/mirth-connect-channel-examples/master/channels/json_to_hl7_dest_channel_writer/channel.xml" -O /tmp/channel.xml
then, use curl to import the channel to mirth connect:
sudo docker exec mirth-container-name curl --insecure -X POST "https://admin:admin@localhost:8443/api/channels" -H "accept: application/json" -H "Content-Type: application/xml" -H "X-Requested-With: OpenAPI" -d @/tmp/channel.xml
and finally use curl to redeploy all channels:
sudo docker exec mirth-container-name curl --insecure -X POST "https://admin:admin@localhost:8443/api/channels/_redeployAll" -H "accept: application/xml" -H "X-Requested-With: OpenAPI"