Skip to content

Commit

Permalink
fix!: Correct env-var related path issues in the docker image
Browse files Browse the repository at this point in the history
Fixes #11
  • Loading branch information
tlater-famedly committed Aug 13, 2024
1 parent 9995b4c commit 7d4eed6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
11 changes: 5 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM ghcr.io/famedly/rust-container:nightly as builder
ARG PROJECT_NAME=famedly-sync-agent
ARG CARGO_NET_GIT_FETCH_WITH_CLI=true
ARG FAMEDLY_CRATES_REGISTRY
ARG CARGO_HOME
Expand All @@ -23,8 +22,8 @@ RUN cargo auditable build --release

FROM debian:bookworm-slim
RUN apt update && apt install ca-certificates -y
RUN mkdir -p /opt/${PROJECT_NAME}
WORKDIR /opt/${PROJECT_NAME}
COPY --from=builder /app/target/release/${PROJECT_NAME} /usr/local/bin/${PROJECT_NAME}
ENV FAMEDLY_LDAP_SYNC_CONFIG="/opt/config.yaml"
ENTRYPOINT ["/usr/local/bin/ldap-sync"]
RUN mkdir -p /opt/famedly-sync-agent
WORKDIR /opt/famedly-sync-agent
COPY --from=builder /app/target/release/ldap-sync /usr/local/bin/famedly-sync-agent
ENV FAMEDLY_LDAP_SYNC_CONFIG="/opt/famedly-sync-agent/config.yaml"
ENTRYPOINT ["/usr/local/bin/famedly-sync-agent"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ docker compose up
Or alternatively, without `docker compose`:

```
docker run --rm -it --network host --volume ./opt:/opt docker-oss.nexus.famedly.de/famedly-sync-agent:latest
docker run --rm -it --network host --volume ./opt:/opt/famedly-sync-agent docker-oss.nexus.famedly.de/famedly-sync-agent:latest
```

## Quirks & Edge Cases
Expand Down
6 changes: 3 additions & 3 deletions config.sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ldap:
url: ldap://ldap.example.invalid
start_tls: false
no_tls_verify: false
root_certificates_path: /opt/certs/test-ldap.crt
root_certificates_path: /opt/famedly-sync-agent/certs/test-ldap.crt
# The base DN whose users to sync.
base_dn: ou=testorg,dc=example,dc=org
# The DN to bind - this should be a user with sufficient permissions
Expand Down Expand Up @@ -73,7 +73,7 @@ famedly:
# The Famedly user endpoint to sync to.
url: https://auth.famedly.de
# The Famedly-provided service user credentials.
key_file: /opt/service-user.json
key_file: /opt/famedly-sync-agent/service-user.json
# The organization whose users to sync.
organization_id: 278274756195721220
# The project to grant users access to.
Expand All @@ -89,4 +89,4 @@ feature_flags:
# Path to the file that keeps track of previously synced entries -
# this file should be persisted, otherwise users may become out of
# sync.
cache_path: /opt/famedly-sync.cache
cache_path: /opt/famedly-sync-agent/famedly-sync.cache
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
services:
ldap-sync:
famedly-sync-agent:
image: docker-oss.nexus.famedly.de/famedly-sync-agent:latest
volumes:
- type: bind
source: ./opt
target: /opt
target: /opt/famedly-sync-agent
network_mode: host

0 comments on commit 7d4eed6

Please sign in to comment.