I'm new to docker and erlang. I've installed docker and VSCode on my windows machine and I want to learn to develop erlang in the container, so I created Dockerfile:
FROM erlang:latest
WORKDIR /project
COPY . .
and .devcontainer directory with devcontainer.json file:
{
"name": "Erlang dev container",
"context": ".",
"dockerFile": "Dockerfile",
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
"extensions": []
}
After I opened my project folder in container I can issue bash commands and I can start erl but when I try to ask rebar to test my code with
rebar eunit
or
rebar3 eunit
I get error:
can't find include lib "eunit/lib/eunit.hrl"
What did I do wrong? Is the erlang:latest image supposed to be used for erlang development? How to fix it?
1条答案
按热度按时间fhg3lkii1#
为了使用
eunit
,当我在shell中运行erlang程序(不使用docker)时,我使用了以下-include_lib
指令:你似乎走的是另一条路:
在容器中,我可以发出bash命令
然后使用bash命令搜索文件
eunit.hrl
。您始终可以复制文件eunit.hrl并将其放在rebar项目的
src
目录中,然后在模块中用途:我是新来的。
如果最坏的情况发生,不要担心eunit,在你需要一个测试框架之前,有很多关于erlang的知识需要学习。