ドッキング用のコンテナを作成して、ユーザーにdocker run...
と入力するだけで、どのシステムでもHTMLファイルを実行できます。 これは、HTMLコードです:Docker - ドッカーでHTMLファイルを実行
<!doctype html>
<html>
<style>
body {
padding: 20px 5%;
color: white;
font-family: Sabon, serif;
margin: auto;
max-width: 800px;
}
@media (min-width: 600px) {
}
</style>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>D & T</title>
</head>
<body>
<center>
<div id="headline">
<header>
<h1>Date and Time</h1>
<p></p>
</header>
<div id="blurb">
<p>This page will show you your current local time.</p>
</div>
</div>
<div id="section1">
<h2></h2>
<p>It is now</p>
</div>
<div id="section2">
<script type="text/javascript">
document.write ('<p>----<span id="date-time">', new Date().toLocaleString(), '<\/span>----<\/p>')
if (document.getElementById) onload = function() {
setInterval ("document.getElementById ('date-time').firstChild.data = new Date().toLocaleString()", 50)
}
</script>
</div>
<div id="section3">
<div style="position: absolute; bottom: 5px">
<i>RG</i>
</div>
</div>
<footer>
<p><i>Created 26 May 2017</i></p>
</footer>
</center>
</body>
</html>
私は現在のUbuntu 14.04環境を使用してHTMLファイルを開こうとlinks2を取得するためにwgetのを使用して、その後、htmlファイルを開くにはのxdg-オープンを使用しています。しかし、私はページを取得していない。 docker run...
は何もしません。エラーはありませんが、Webページもありません。 これは私のDockerfile
です:
FROM ubuntu:14.04
WORKDIR /app
ADD . /app
USER root
RUN apt-get update
RUN apt-get install --no-install-recommends xdg-utils
RUN apt-get install -y --no-install-recommends links2
RUN xdg-open datetime.html
任意の代替または正解?
を参照してください。ファイルがそのフォルダに移動し、実行可能な状態になりますとき
:あなたのDockerfileは次のようになります。 ?このhtmlをブラウザに表示したいのですか? – arbogastes
はい、ブラウザにあります。それも可能ですか? – user7091463