레이블이 Docker인 게시물을 표시합니다. 모든 게시물 표시
레이블이 Docker인 게시물을 표시합니다. 모든 게시물 표시

2026년 11월 7일 토요일

[English] Docker Daemon Is Not Running in WSL Ubuntu: How to Start It

Korean original: docker daemon is not running in WSL Ubuntu

Symptom

When you run a docker command in WSL, you see this message. It means the Docker daemon is not running.

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Quick fix

  1. Launch WSL with administrator privileges.
  2. Switch to root with su - root.
  3. Run dockerd.

You can also try starting it as a service with sudo service docker start.

Check that the daemon is running

If docker info or docker ps prints a result without errors, the daemon is running.

Keep it running after you close the terminal

If you run dockerd in the foreground, the daemon stops when you close that terminal. To run it in the background, use the command below and read /tmp/dockerd.log if something goes wrong. After a full WSL shutdown you need to start it again.

sudo dockerd > /tmp/dockerd.log 2>&1 &

Start Docker automatically

  • On WSL2 with systemd enabled, Docker can be configured to start automatically when WSL boots.
  • On Windows, using Docker Desktop is another option.

Related error

If docker-compose fails with an iptables error such as "Unable to enable NAT rule", see the Korean post docker-compose error (Unable to enable NAT rule). The workaround there is a temporary one, and WSL2 is recommended over WSL1.

Originally written in 2020 in Korean. This English version was added in November 2026.

[English] Push a Docker Image to Google Cloud from WSL (Artifact Registry)

Korean original: Push Docker Image to GCR from WSL

Important: gcr.io is no longer available

Google Container Registry (gcr.io) has been shut down, and image writes have been blocked since March 18, 2025. Use Artifact Registry instead, or migrate your existing gcr.io addresses to it. The commands below use the Seoul region (asia-northeast3). Replace PROJECT_ID and REPO with your own values.

gcloud auth configure-docker asia-northeast3-docker.pkg.dev
gcloud artifacts repositories create REPO --repository-format=docker --location=asia-northeast3
docker tag config-server asia-northeast3-docker.pkg.dev/PROJECT_ID/REPO/config-server:latest
docker push asia-northeast3-docker.pkg.dev/PROJECT_ID/REPO/config-server:latest

What happened in the original 2020 log

The first push to the old gcr.io address failed with an error saying there was no active gcloud account, followed by an unauthorized error. The fix was to log in with gcloud auth login, set the project with gcloud config set project PROJECT_ID, and push again. The second push succeeded.

If the push fails: checklist

  1. Active account: run gcloud auth list. If no account is active, run gcloud auth login.
  2. Project: run gcloud config list and check the project value. If it is empty, run gcloud config set project PROJECT_ID.
  3. Docker credentials: run gcloud auth configure-docker with your registry host, for example asia-northeast3-docker.pkg.dev.
  4. Permissions: if you still get unauthorized or permission denied, check in IAM that your account has the Artifact Registry Writer role (roles/artifactregistry.writer).
  5. Repository exists: Artifact Registry needs the repository to be created before the first push, and the REPO name in the image tag must match it.

Verify the upload

List the images in the repository:

gcloud artifacts docker images list asia-northeast3-docker.pkg.dev/PROJECT_ID/REPO

Originally written in 2020 in Korean. This English version was added in November 2026.