R
Railway14mo ago
joe

Docker BuildKit Secrets (--secret and --mount=type=secret)

Project ID: 9fa9ca70-2c84-423b-9f45-39e39a0c7a0f Service ID: 108e166f-6409-417f-ab3a-fbf9884561f0 Does Railway support Docker builds using BuildKit? I want to use secrets in a secure way (i.e. https://docs.docker.com/engine/reference/commandline/buildx_build/) Building the following Dockerfile...
# syntax=docker/dockerfile:1
FROM ubuntu:23.10

RUN apt-get update && apt-get install -y git

RUN --mount=type=secret,id=git-user-password \
useradd -m -p $(openssl passwd -1 $(cat /run/secrets/git-user-password)) git
# syntax=docker/dockerfile:1
FROM ubuntu:23.10

RUN apt-get update && apt-get install -y git

RUN --mount=type=secret,id=git-user-password \
useradd -m -p $(openssl passwd -1 $(cat /run/secrets/git-user-password)) git
...with the following command... docker build --secret id=git-user-password,src=secrets/git-user-password ...works on my machine, but when I deploy with wsl -u root railway up, I get the error Cache mounts MUST be in the format --mount=type=cache,id=<cache-id>
Solution:
use build args instead
Jump to solution
2 Replies
Percy
Percy14mo ago
Project ID: 108e166f-6409-417f-ab3a-fbf9884561f0
Solution
Brody
Brody14mo ago
use build args instead
Want results from more Discord servers?
Add your server