Fix ssh from host not working in docker
This commit is contained in:
@@ -1,6 +1,27 @@
|
||||
services:
|
||||
apparel-designer:
|
||||
build: { context: ., dockerfile: Dockerfile }
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
# Forward the host's SSH agent into the build. Needed because
|
||||
# the `goods-editor` npm dependency uses a git+ssh: URL, so
|
||||
# `npm install` has to authenticate against git.kadil.dev
|
||||
# during the build. "default" means "use the SSH_AUTH_SOCK
|
||||
# environment variable on the host" — matches the build
|
||||
# command `docker build --ssh default`.
|
||||
#
|
||||
# The host running `docker compose build` must have:
|
||||
# • An ssh-agent running with the right key loaded
|
||||
# (verify with `ssh-add -l`).
|
||||
# • Docker 23+ (BuildKit is the default; older versions
|
||||
# need `DOCKER_BUILDKIT=1` exported).
|
||||
#
|
||||
# No SSH material is baked into the image — the agent is only
|
||||
# available during the single RUN step in the Dockerfile that
|
||||
# has `--mount=type=ssh`. See the Dockerfile docblock for the
|
||||
# full mechanism.
|
||||
ssh:
|
||||
- default
|
||||
container_name: apparel-designer
|
||||
ports: ["3001:3001"]
|
||||
volumes:
|
||||
|
||||
Reference in New Issue
Block a user