Unable to run docker-compose












1















Following this article on Jhipster, I build the project. I, however, can't run docker-compose. So, I try to figure out the problem. I walk step by step with this Docker-Compose article without luck.



$ sudo service docker status
docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2018-12-27 15:40:22 PST; 2 days ago
Docs: https://docs.docker.com
Main PID: 1960 (dockerd)
Tasks: 20 (limit: 4440)
Memory: 68.2M
CGroup: /system.slice/docker.service
├─1960 /usr/bin/dockerd -H fd://
└─2093 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --s

Dec 27 15:40:10 tk-PC dockerd[1960]: time="2018-12-27T15:40:10.493340278-08:00" level=warning msg="Your kernel does not support swap memory li
Dec 27 15:40:10 tk-PC dockerd[1960]: time="2018-12-27T15:40:10.493612101-08:00" level=warning msg="Your kernel does not support cgroup rt peri
Dec 27 15:40:10 tk-PC dockerd[1960]: time="2018-12-27T15:40:10.493681034-08:00" level=warning msg="Your kernel does not support cgroup rt runt
Dec 27 15:40:10 tk-PC dockerd[1960]: time="2018-12-27T15:40:10.496381656-08:00" level=info msg="Loading containers: start."
Dec 27 15:40:17 tk-PC dockerd[1960]: time="2018-12-27T15:40:17.498415923-08:00" level=info msg="Default bridge (docker0) is assigned with an I
Dec 27 15:40:19 tk-PC dockerd[1960]: time="2018-12-27T15:40:19.646853084-08:00" level=info msg="Loading containers: done."
Dec 27 15:40:22 tk-PC dockerd[1960]: time="2018-12-27T15:40:22.512083092-08:00" level=info msg="Daemon has completed initialization"
Dec 27 15:40:22 tk-PC dockerd[1960]: time="2018-12-27T15:40:22.512266914-08:00" level=info msg="Docker daemon" commit=89658be graphdriver=aufs
Dec 27 15:40:22 tk-PC dockerd[1960]: time="2018-12-27T15:40:22.553322342-08:00" level=info msg="API listen on /var/run/docker.sock"
Dec 27 15:40:22 tk-PC systemd[1]: Started Docker Application Container Engine.

$ sudo ls -la /var/run/docker.sock
srw-rw---- 1 root docker 0 Dec 27 15:39 /var/run/docker.sock

$ sudo usermod -aG docker ${USER}

$ docker-compose -f docker-compose.yml build --build-arg UID=$(id -u)
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.


The result of the last step is the same as "docker-compose up -d". According to the article, it would be a permission problem if the problem still exists at this point. How can I find what permission issue?










share|improve this question

























  • Does it throw any error message?

    – Andellys
    Dec 30 '18 at 0:18











  • Yes, on the last step.

    – vic
    Dec 30 '18 at 0:27
















1















Following this article on Jhipster, I build the project. I, however, can't run docker-compose. So, I try to figure out the problem. I walk step by step with this Docker-Compose article without luck.



$ sudo service docker status
docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2018-12-27 15:40:22 PST; 2 days ago
Docs: https://docs.docker.com
Main PID: 1960 (dockerd)
Tasks: 20 (limit: 4440)
Memory: 68.2M
CGroup: /system.slice/docker.service
├─1960 /usr/bin/dockerd -H fd://
└─2093 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --s

Dec 27 15:40:10 tk-PC dockerd[1960]: time="2018-12-27T15:40:10.493340278-08:00" level=warning msg="Your kernel does not support swap memory li
Dec 27 15:40:10 tk-PC dockerd[1960]: time="2018-12-27T15:40:10.493612101-08:00" level=warning msg="Your kernel does not support cgroup rt peri
Dec 27 15:40:10 tk-PC dockerd[1960]: time="2018-12-27T15:40:10.493681034-08:00" level=warning msg="Your kernel does not support cgroup rt runt
Dec 27 15:40:10 tk-PC dockerd[1960]: time="2018-12-27T15:40:10.496381656-08:00" level=info msg="Loading containers: start."
Dec 27 15:40:17 tk-PC dockerd[1960]: time="2018-12-27T15:40:17.498415923-08:00" level=info msg="Default bridge (docker0) is assigned with an I
Dec 27 15:40:19 tk-PC dockerd[1960]: time="2018-12-27T15:40:19.646853084-08:00" level=info msg="Loading containers: done."
Dec 27 15:40:22 tk-PC dockerd[1960]: time="2018-12-27T15:40:22.512083092-08:00" level=info msg="Daemon has completed initialization"
Dec 27 15:40:22 tk-PC dockerd[1960]: time="2018-12-27T15:40:22.512266914-08:00" level=info msg="Docker daemon" commit=89658be graphdriver=aufs
Dec 27 15:40:22 tk-PC dockerd[1960]: time="2018-12-27T15:40:22.553322342-08:00" level=info msg="API listen on /var/run/docker.sock"
Dec 27 15:40:22 tk-PC systemd[1]: Started Docker Application Container Engine.

$ sudo ls -la /var/run/docker.sock
srw-rw---- 1 root docker 0 Dec 27 15:39 /var/run/docker.sock

$ sudo usermod -aG docker ${USER}

$ docker-compose -f docker-compose.yml build --build-arg UID=$(id -u)
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.


The result of the last step is the same as "docker-compose up -d". According to the article, it would be a permission problem if the problem still exists at this point. How can I find what permission issue?










share|improve this question

























  • Does it throw any error message?

    – Andellys
    Dec 30 '18 at 0:18











  • Yes, on the last step.

    – vic
    Dec 30 '18 at 0:27














1












1








1








Following this article on Jhipster, I build the project. I, however, can't run docker-compose. So, I try to figure out the problem. I walk step by step with this Docker-Compose article without luck.



$ sudo service docker status
docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2018-12-27 15:40:22 PST; 2 days ago
Docs: https://docs.docker.com
Main PID: 1960 (dockerd)
Tasks: 20 (limit: 4440)
Memory: 68.2M
CGroup: /system.slice/docker.service
├─1960 /usr/bin/dockerd -H fd://
└─2093 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --s

Dec 27 15:40:10 tk-PC dockerd[1960]: time="2018-12-27T15:40:10.493340278-08:00" level=warning msg="Your kernel does not support swap memory li
Dec 27 15:40:10 tk-PC dockerd[1960]: time="2018-12-27T15:40:10.493612101-08:00" level=warning msg="Your kernel does not support cgroup rt peri
Dec 27 15:40:10 tk-PC dockerd[1960]: time="2018-12-27T15:40:10.493681034-08:00" level=warning msg="Your kernel does not support cgroup rt runt
Dec 27 15:40:10 tk-PC dockerd[1960]: time="2018-12-27T15:40:10.496381656-08:00" level=info msg="Loading containers: start."
Dec 27 15:40:17 tk-PC dockerd[1960]: time="2018-12-27T15:40:17.498415923-08:00" level=info msg="Default bridge (docker0) is assigned with an I
Dec 27 15:40:19 tk-PC dockerd[1960]: time="2018-12-27T15:40:19.646853084-08:00" level=info msg="Loading containers: done."
Dec 27 15:40:22 tk-PC dockerd[1960]: time="2018-12-27T15:40:22.512083092-08:00" level=info msg="Daemon has completed initialization"
Dec 27 15:40:22 tk-PC dockerd[1960]: time="2018-12-27T15:40:22.512266914-08:00" level=info msg="Docker daemon" commit=89658be graphdriver=aufs
Dec 27 15:40:22 tk-PC dockerd[1960]: time="2018-12-27T15:40:22.553322342-08:00" level=info msg="API listen on /var/run/docker.sock"
Dec 27 15:40:22 tk-PC systemd[1]: Started Docker Application Container Engine.

$ sudo ls -la /var/run/docker.sock
srw-rw---- 1 root docker 0 Dec 27 15:39 /var/run/docker.sock

$ sudo usermod -aG docker ${USER}

$ docker-compose -f docker-compose.yml build --build-arg UID=$(id -u)
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.


The result of the last step is the same as "docker-compose up -d". According to the article, it would be a permission problem if the problem still exists at this point. How can I find what permission issue?










share|improve this question
















Following this article on Jhipster, I build the project. I, however, can't run docker-compose. So, I try to figure out the problem. I walk step by step with this Docker-Compose article without luck.



$ sudo service docker status
docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2018-12-27 15:40:22 PST; 2 days ago
Docs: https://docs.docker.com
Main PID: 1960 (dockerd)
Tasks: 20 (limit: 4440)
Memory: 68.2M
CGroup: /system.slice/docker.service
├─1960 /usr/bin/dockerd -H fd://
└─2093 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --s

Dec 27 15:40:10 tk-PC dockerd[1960]: time="2018-12-27T15:40:10.493340278-08:00" level=warning msg="Your kernel does not support swap memory li
Dec 27 15:40:10 tk-PC dockerd[1960]: time="2018-12-27T15:40:10.493612101-08:00" level=warning msg="Your kernel does not support cgroup rt peri
Dec 27 15:40:10 tk-PC dockerd[1960]: time="2018-12-27T15:40:10.493681034-08:00" level=warning msg="Your kernel does not support cgroup rt runt
Dec 27 15:40:10 tk-PC dockerd[1960]: time="2018-12-27T15:40:10.496381656-08:00" level=info msg="Loading containers: start."
Dec 27 15:40:17 tk-PC dockerd[1960]: time="2018-12-27T15:40:17.498415923-08:00" level=info msg="Default bridge (docker0) is assigned with an I
Dec 27 15:40:19 tk-PC dockerd[1960]: time="2018-12-27T15:40:19.646853084-08:00" level=info msg="Loading containers: done."
Dec 27 15:40:22 tk-PC dockerd[1960]: time="2018-12-27T15:40:22.512083092-08:00" level=info msg="Daemon has completed initialization"
Dec 27 15:40:22 tk-PC dockerd[1960]: time="2018-12-27T15:40:22.512266914-08:00" level=info msg="Docker daemon" commit=89658be graphdriver=aufs
Dec 27 15:40:22 tk-PC dockerd[1960]: time="2018-12-27T15:40:22.553322342-08:00" level=info msg="API listen on /var/run/docker.sock"
Dec 27 15:40:22 tk-PC systemd[1]: Started Docker Application Container Engine.

$ sudo ls -la /var/run/docker.sock
srw-rw---- 1 root docker 0 Dec 27 15:39 /var/run/docker.sock

$ sudo usermod -aG docker ${USER}

$ docker-compose -f docker-compose.yml build --build-arg UID=$(id -u)
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.


The result of the last step is the same as "docker-compose up -d". According to the article, it would be a permission problem if the problem still exists at this point. How can I find what permission issue?







docker






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 30 '18 at 0:26







vic

















asked Dec 30 '18 at 0:14









vicvic

6881435




6881435













  • Does it throw any error message?

    – Andellys
    Dec 30 '18 at 0:18











  • Yes, on the last step.

    – vic
    Dec 30 '18 at 0:27



















  • Does it throw any error message?

    – Andellys
    Dec 30 '18 at 0:18











  • Yes, on the last step.

    – vic
    Dec 30 '18 at 0:27

















Does it throw any error message?

– Andellys
Dec 30 '18 at 0:18





Does it throw any error message?

– Andellys
Dec 30 '18 at 0:18













Yes, on the last step.

– vic
Dec 30 '18 at 0:27





Yes, on the last step.

– vic
Dec 30 '18 at 0:27












1 Answer
1






active

oldest

votes


















1














There are multiple ways you can solve this problem. Firstly try to export environment variable of docker host with command:



export DOCKER_HOST=/var/run/docker.sock


If it works you can add the same line to your bashrc config to save this export permanently.



If it doesn't work you can try to modify docker daemon config. It located in



/etc/docker/daemon.json


You'll need to append the localhost to your hosts like that:



"hosts": ["old_hosts_not_modified_only_append_new_one", "tcp://localhost:2376"],


and restart docker daemon using command:



service docker restart


Hope it gonna help ya






share|improve this answer
























  • Thanks very much. After adding the export statement in the .bashrc file and sourcing it, I can run docker-compose with sudo.

    – vic
    Dec 30 '18 at 0:43











  • @vic glad to help ya! One more trick: you can add alias for docker-compose to run it without typing sudo every time. You need simply add something like " alias docker-compose='sudo docker-compose' " (without quotes) to your .bashrc or even simplify this command, for example " alias compose='sudo docker-compose' ".

    – Andellys
    Dec 30 '18 at 0:46











  • Thanks for the tip. I had learned the alia command before, a long time ago and totally forgot about it. (:

    – vic
    Dec 30 '18 at 0:57











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53974334%2funable-to-run-docker-compose%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














There are multiple ways you can solve this problem. Firstly try to export environment variable of docker host with command:



export DOCKER_HOST=/var/run/docker.sock


If it works you can add the same line to your bashrc config to save this export permanently.



If it doesn't work you can try to modify docker daemon config. It located in



/etc/docker/daemon.json


You'll need to append the localhost to your hosts like that:



"hosts": ["old_hosts_not_modified_only_append_new_one", "tcp://localhost:2376"],


and restart docker daemon using command:



service docker restart


Hope it gonna help ya






share|improve this answer
























  • Thanks very much. After adding the export statement in the .bashrc file and sourcing it, I can run docker-compose with sudo.

    – vic
    Dec 30 '18 at 0:43











  • @vic glad to help ya! One more trick: you can add alias for docker-compose to run it without typing sudo every time. You need simply add something like " alias docker-compose='sudo docker-compose' " (without quotes) to your .bashrc or even simplify this command, for example " alias compose='sudo docker-compose' ".

    – Andellys
    Dec 30 '18 at 0:46











  • Thanks for the tip. I had learned the alia command before, a long time ago and totally forgot about it. (:

    – vic
    Dec 30 '18 at 0:57
















1














There are multiple ways you can solve this problem. Firstly try to export environment variable of docker host with command:



export DOCKER_HOST=/var/run/docker.sock


If it works you can add the same line to your bashrc config to save this export permanently.



If it doesn't work you can try to modify docker daemon config. It located in



/etc/docker/daemon.json


You'll need to append the localhost to your hosts like that:



"hosts": ["old_hosts_not_modified_only_append_new_one", "tcp://localhost:2376"],


and restart docker daemon using command:



service docker restart


Hope it gonna help ya






share|improve this answer
























  • Thanks very much. After adding the export statement in the .bashrc file and sourcing it, I can run docker-compose with sudo.

    – vic
    Dec 30 '18 at 0:43











  • @vic glad to help ya! One more trick: you can add alias for docker-compose to run it without typing sudo every time. You need simply add something like " alias docker-compose='sudo docker-compose' " (without quotes) to your .bashrc or even simplify this command, for example " alias compose='sudo docker-compose' ".

    – Andellys
    Dec 30 '18 at 0:46











  • Thanks for the tip. I had learned the alia command before, a long time ago and totally forgot about it. (:

    – vic
    Dec 30 '18 at 0:57














1












1








1







There are multiple ways you can solve this problem. Firstly try to export environment variable of docker host with command:



export DOCKER_HOST=/var/run/docker.sock


If it works you can add the same line to your bashrc config to save this export permanently.



If it doesn't work you can try to modify docker daemon config. It located in



/etc/docker/daemon.json


You'll need to append the localhost to your hosts like that:



"hosts": ["old_hosts_not_modified_only_append_new_one", "tcp://localhost:2376"],


and restart docker daemon using command:



service docker restart


Hope it gonna help ya






share|improve this answer













There are multiple ways you can solve this problem. Firstly try to export environment variable of docker host with command:



export DOCKER_HOST=/var/run/docker.sock


If it works you can add the same line to your bashrc config to save this export permanently.



If it doesn't work you can try to modify docker daemon config. It located in



/etc/docker/daemon.json


You'll need to append the localhost to your hosts like that:



"hosts": ["old_hosts_not_modified_only_append_new_one", "tcp://localhost:2376"],


and restart docker daemon using command:



service docker restart


Hope it gonna help ya







share|improve this answer












share|improve this answer



share|improve this answer










answered Dec 30 '18 at 0:29









AndellysAndellys

33416




33416













  • Thanks very much. After adding the export statement in the .bashrc file and sourcing it, I can run docker-compose with sudo.

    – vic
    Dec 30 '18 at 0:43











  • @vic glad to help ya! One more trick: you can add alias for docker-compose to run it without typing sudo every time. You need simply add something like " alias docker-compose='sudo docker-compose' " (without quotes) to your .bashrc or even simplify this command, for example " alias compose='sudo docker-compose' ".

    – Andellys
    Dec 30 '18 at 0:46











  • Thanks for the tip. I had learned the alia command before, a long time ago and totally forgot about it. (:

    – vic
    Dec 30 '18 at 0:57



















  • Thanks very much. After adding the export statement in the .bashrc file and sourcing it, I can run docker-compose with sudo.

    – vic
    Dec 30 '18 at 0:43











  • @vic glad to help ya! One more trick: you can add alias for docker-compose to run it without typing sudo every time. You need simply add something like " alias docker-compose='sudo docker-compose' " (without quotes) to your .bashrc or even simplify this command, for example " alias compose='sudo docker-compose' ".

    – Andellys
    Dec 30 '18 at 0:46











  • Thanks for the tip. I had learned the alia command before, a long time ago and totally forgot about it. (:

    – vic
    Dec 30 '18 at 0:57

















Thanks very much. After adding the export statement in the .bashrc file and sourcing it, I can run docker-compose with sudo.

– vic
Dec 30 '18 at 0:43





Thanks very much. After adding the export statement in the .bashrc file and sourcing it, I can run docker-compose with sudo.

– vic
Dec 30 '18 at 0:43













@vic glad to help ya! One more trick: you can add alias for docker-compose to run it without typing sudo every time. You need simply add something like " alias docker-compose='sudo docker-compose' " (without quotes) to your .bashrc or even simplify this command, for example " alias compose='sudo docker-compose' ".

– Andellys
Dec 30 '18 at 0:46





@vic glad to help ya! One more trick: you can add alias for docker-compose to run it without typing sudo every time. You need simply add something like " alias docker-compose='sudo docker-compose' " (without quotes) to your .bashrc or even simplify this command, for example " alias compose='sudo docker-compose' ".

– Andellys
Dec 30 '18 at 0:46













Thanks for the tip. I had learned the alia command before, a long time ago and totally forgot about it. (:

– vic
Dec 30 '18 at 0:57





Thanks for the tip. I had learned the alia command before, a long time ago and totally forgot about it. (:

– vic
Dec 30 '18 at 0:57


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53974334%2funable-to-run-docker-compose%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Mossoró

Error while reading .h5 file using the rhdf5 package in R

Pushsharp Apns notification error: 'InvalidToken'