Skip to content

Commit

Permalink
fix: resolve docker build permission issues
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Apr 10, 2020
1 parent 317b0ea commit f3612e8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .docker/Dockerfile-build
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ RUN CGO_ENABLED=1 go build -tags sqlite -a -o /usr/bin/kratos
EXPOSE 4433
EXPOSE 4434

# By creating the sqlite folder as the ory user, the mounted volume will be owned by ory:ory, which
# is required for read/write of SQLite.
RUN mkdir -p /var/lib/sqlite
RUN chown ory:ory /var/lib/sqlite
VOLUME /var/lib/sqlite

USER ory

ENTRYPOINT ["kratos"]
Expand Down
9 changes: 5 additions & 4 deletions .docker/Dockerfile-sqlite
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ WORKDIR /home/ory

COPY kratos-sqlite-libmusl /usr/bin/kratos

USER ory

# By creating the sqlite folder as the ory user, the mounted volume will be owned by ory:ory, which
# is required for read/write of SQLite.
RUN mkdir -p /home/ory/sqlite
VOLUME /home/ory/sqlite
RUN mkdir -p /var/lib/sqlite
RUN chown ory:ory /var/lib/sqlite
VOLUME /var/lib/sqlite

USER ory

ENTRYPOINT ["kratos"]
CMD ["serve"]
8 changes: 4 additions & 4 deletions quickstart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ services:
kratos-migrate:
image: oryd/kratos:latest-sqlite
environment:
- DSN=sqlite:///home/ory/sqlite/db.sqlite?_fk=true
- DSN=sqlite:///var/lib/sqlite/db.sqlite?_fk=true&mode=rwc
volumes:
-
type: volume
source: kratos-sqlite
target: /home/ory/sqlite
target: /var/lib/sqlite
read_only: false
-
type: bind
Expand Down Expand Up @@ -69,14 +69,14 @@ services:
- "4434:4434" # admin
restart: unless-stopped
environment:
- DSN=sqlite:///home/ory/sqlite/db.sqlite?_fk=true
- DSN=sqlite:///var/lib/sqlite/db.sqlite?_fk=true
command:
serve -c /etc/config/kratos/.kratos.yml --dev
volumes:
-
type: volume
source: kratos-sqlite
target: /home/ory/sqlite
target: /var/lib/sqlite
read_only: false
-
type: bind
Expand Down

0 comments on commit f3612e8

Please sign in to comment.