Skip to content
This repository was archived by the owner on Oct 12, 2025. It is now read-only.

Commit ae38af3

Browse files
authored
[fix] Disable AutoUpdater in docker (#814)
* [Docker] Add EnvVar to disable auto update * [fix] Disable AutoUpdater in docker * [fix] Disable AutoUpdater in docker
1 parent 7ce94a4 commit ae38af3

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Lagrange.OneBot/Resources/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ WORKDIR /app/data
1616
COPY --from=build-env /root/out /app/bin
1717
COPY Lagrange.OneBot/Resources/docker-entrypoint.sh /app/bin/docker-entrypoint.sh
1818

19+
ENV RUNNING_IN_DOCKER=true
20+
1921
RUN apt-get update \
2022
&& apt-get -y --no-install-recommends install gosu \
2123
&& chmod +x /app/bin/docker-entrypoint.sh
2224

23-
ENTRYPOINT ["/app/bin/docker-entrypoint.sh"]
25+
ENTRYPOINT ["/app/bin/docker-entrypoint.sh"]

Lagrange.OneBot/Updater/GithubUpdater.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ public GithubUpdater()
6969

7070
public async Task GetConfig()
7171
{
72+
if(Environment.GetEnvironmentVariable("RUNNING_IN_DOCKER") == "true")
73+
{
74+
Config = new UpdaterConfig();
75+
return;
76+
}
77+
7278
string configPath = Path.Combine(_executableDirectory, "AutoUpdaterConfig.json");
7379

7480
if (File.Exists(configPath))

0 commit comments

Comments
 (0)