International Rice Research Institute commited on
Commit
f77af65
·
verified ·
1 Parent(s): 999dcc9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -15
Dockerfile CHANGED
@@ -82,42 +82,57 @@ RUN install2.r --error --repo https://cloud.r-project.org \
82
  qtl \
83
  > install_qtl.log 2>&1 || cat install_qtl.log
84
 
 
 
 
 
 
 
 
85
  # Install QTLseqr from GitHub with specific error handling
86
- RUN R -e "options(timeout = 600); \
87
  if (!requireNamespace('QTLseqr', quietly = TRUE)) { \
88
  tryCatch({ \
89
  remotes::install_github('bmansfeld/QTLseqr') \
90
  }, error = function(e) { \
91
  message('GitHub installation failed: ', e$message); \
92
- # Try alternative repository or specific commit \
93
  tryCatch({ \
94
  remotes::install_github('bmansfeld/QTLseqr@HEAD') \
95
  }, error = function(e) { \
96
  message('Alternative installation failed: ', e$message); \
97
- # Install dependencies manually first \
98
- install.packages(c('data.table', 'ggplot2', 'dplyr', 'tidyr'), repos='https://cloud.r-project.org'); \
99
- remotes::install_github('bmansfeld/QTLseqr', dependencies = FALSE) \
 
 
100
  }) \
101
- }) \
 
 
 
102
  }" > install_QTLseqr.log 2>&1 && cat install_QTLseqr.log
103
 
104
  # Install qtlTools from GitHub with error handling
105
- RUN R -e "options(timeout = 600); \
106
  if (!requireNamespace('qtlTools', quietly = TRUE)) { \
107
  tryCatch({ \
108
  remotes::install_github('jtlovell/qtlTools') \
109
  }, error = function(e) { \
110
  message('GitHub installation failed: ', e$message); \
111
- # Try installing from CRAN if available \
112
  tryCatch({ \
113
  install.packages('qtlTools', repos='https://cloud.r-project.org') \
114
  }, error = function(e) { \
115
  message('CRAN installation also failed: ', e$message); \
116
- # Install minimal dependencies and try again \
117
- install.packages(c('qtl', 'dplyr', 'tidyr'), repos='https://cloud.r-project.org'); \
118
- remotes::install_github('jtlovell/qtlTools', dependencies = FALSE) \
 
 
119
  }) \
120
- }) \
 
 
 
121
  }" > install_qtlTools.log 2>&1 && cat install_qtlTools.log
122
 
123
  # Verify installations
@@ -126,10 +141,12 @@ RUN R -e " \
126
  cat('QTLseqr available:', requireNamespace('QTLseqr', quietly = TRUE), '\\n'); \
127
  cat('qtlTools available:', requireNamespace('qtlTools', quietly = TRUE), '\\n'); \
128
  if (!requireNamespace('QTLseqr', quietly = TRUE)) { \
129
- warning('QTLseqr not installed'); \
130
- } \
 
131
  if (!requireNamespace('qtlTools', quietly = TRUE)) { \
132
- warning('qtlTools not installed'); \
 
133
  } \
134
  " > verify_install.log 2>&1 && cat verify_install.log
135
 
 
82
  qtl \
83
  > install_qtl.log 2>&1 || cat install_qtl.log
84
 
85
+ # Install additional dependencies for QTLseqr and qtlTools
86
+ RUN install2.r --error --repo https://cloud.r-project.org \
87
+ ggplot2 \
88
+ gridExtra \
89
+ locfit \
90
+ > install_additional_deps.log 2>&1 || cat install_additional_deps.log
91
+
92
  # Install QTLseqr from GitHub with specific error handling
93
+ RUN R -e "options(timeout = 1200); \
94
  if (!requireNamespace('QTLseqr', quietly = TRUE)) { \
95
  tryCatch({ \
96
  remotes::install_github('bmansfeld/QTLseqr') \
97
  }, error = function(e) { \
98
  message('GitHub installation failed: ', e$message); \
 
99
  tryCatch({ \
100
  remotes::install_github('bmansfeld/QTLseqr@HEAD') \
101
  }, error = function(e) { \
102
  message('Alternative installation failed: ', e$message); \
103
+ install.packages(c('data.table', 'ggplot2', 'dplyr', 'tidyr', 'gridExtra', 'locfit'), repos='https://cloud.r-project.org'); \
104
+ remotes::install_github('bmansfeld/QTLseqr', dependencies = FALSE); \
105
+ if (!requireNamespace('QTLseqr', quietly = TRUE)) { \
106
+ stop('Failed to install QTLseqr'); \
107
+ } \
108
  }) \
109
+ }); \
110
+ if (!requireNamespace('QTLseqr', quietly = TRUE)) { \
111
+ stop('QTLseqr installation failed after all attempts'); \
112
+ } \
113
  }" > install_QTLseqr.log 2>&1 && cat install_QTLseqr.log
114
 
115
  # Install qtlTools from GitHub with error handling
116
+ RUN R -e "options(timeout = 1200); \
117
  if (!requireNamespace('qtlTools', quietly = TRUE)) { \
118
  tryCatch({ \
119
  remotes::install_github('jtlovell/qtlTools') \
120
  }, error = function(e) { \
121
  message('GitHub installation failed: ', e$message); \
 
122
  tryCatch({ \
123
  install.packages('qtlTools', repos='https://cloud.r-project.org') \
124
  }, error = function(e) { \
125
  message('CRAN installation also failed: ', e$message); \
126
+ install.packages(c('qtl', 'dplyr', 'tidyr', 'ggplot2'), repos='https://cloud.r-project.org'); \
127
+ remotes::install_github('jtlovell/qtlTools', dependencies = FALSE); \
128
+ if (!requireNamespace('qtlTools', quietly = TRUE)) { \
129
+ stop('Failed to install qtlTools'); \
130
+ } \
131
  }) \
132
+ }); \
133
+ if (!requireNamespace('qtlTools', quietly = TRUE)) { \
134
+ stop('qtlTools installation failed after all attempts'); \
135
+ } \
136
  }" > install_qtlTools.log 2>&1 && cat install_qtlTools.log
137
 
138
  # Verify installations
 
141
  cat('QTLseqr available:', requireNamespace('QTLseqr', quietly = TRUE), '\\n'); \
142
  cat('qtlTools available:', requireNamespace('qtlTools', quietly = TRUE), '\\n'); \
143
  if (!requireNamespace('QTLseqr', quietly = TRUE)) { \
144
+ message('QTLseqr not installed'); \
145
+ quit(status = 1); \
146
+ }; \
147
  if (!requireNamespace('qtlTools', quietly = TRUE)) { \
148
+ message('qtlTools not installed'); \
149
+ quit(status = 1); \
150
  } \
151
  " > verify_install.log 2>&1 && cat verify_install.log
152