title: How to build using Bazel offline
body: <p>I want to build my jsonnet with Bazel. For that I am using the jsonnet rules. Unfortunately in my build pipelines I can't pull from github. So, I have been reading into offline builds, but I can't seem to find a working solution. I have pulled the jsonnet rules repo and tried to build the jsonnet with</p>
  <pre><code>$ bazel test //project ----distdir=&lt;jsonnet_rules_repo&gt;
  </code></pre>
  <p>But this doesn't work. So, I was wondering if anyone knows the proper way to handle this?</p>
  <p>Update:</p>
  <p>This is the error message</p>
  <pre><code>&gt; ERROR: An error occurred during the fetch of repository 'jsonnet_go':
     Traceback (most recent call last):
      File &quot;/private/var/tmp/_bazel/9246e2215e1e698b5691dcd295e999fc/external/bazel_tools/tools/build_defs/repo/git.bzl&quot;, line 177, column 30, in _git_repository_implementation
          update = _clone_or_update(ctx)
      File &quot;/private/var/tmp/_bazel/9246e2215e1e698b5691dcd295e999fc/external/bazel_tools/tools/build_defs/repo/git.bzl&quot;, line 36, column 20, in _clone_or_update
          git_ = git_repo(ctx, directory)
      File &quot;/private/var/tmp/_bazel/9246e2215e1e698b5691dcd295e999fc/external/bazel_tools/tools/build_defs/repo/git_worker.bzl&quot;, line 91, column 12, in git_repo
          _update(ctx, git_repo)
      File &quot;/private/var/tmp/_bazel/9246e2215e1e698b5691dcd295e999fc/external/bazel_tools/tools/build_defs/repo/git_worker.bzl&quot;, line 103, column 10, in _update
          fetch(ctx, git_repo)
      File &quot;/private/var/tmp/_bazel/9246e2215e1e698b5691dcd295e999fc/external/bazel_tools/tools/build_defs/repo/git_worker.bzl&quot;, line 129, column 27, in fetch
          _git_maybe_shallow(
      File &quot;/private/var/tmp/_bazel/9246e2215e1e698b5691dcd295e999fc/external/bazel_tools/tools/build_defs/repo/git_worker.bzl&quot;, line 171, column 15, in _git_maybe_shallow
          _error(ctx.name, start + args_list, st.stderr)
      File &quot;/private/var/tmp/_bazel/9246e2215e1e698b5691dcd295e999fc/external/bazel_tools/tools/build_defs/repo/git_worker.bzl&quot;, line 182, column 9, in _error
          fail(&quot;error running '%s' while working with @%s:\n%s&quot; % (command_text, name, stderr))
  Error in fail: error running 'git fetch origin refs/heads/*:refs/remotes/origin/* refs/tags/*:refs/tags/*' while working with @jsonnet_go:
  fatal: unable to access 'https://github.com/google/go-jsonnet/': Could not resolve host: github.com
  ERROR: no such package '@jsonnet_go//bazel': error running 'git fetch origin refs/heads/*:refs/remotes/origin/* refs/tags/*:refs/tags/*' while working with @jsonnet_go:
  fatal: unable to access 'https://github.com/google/go-jsonnet/': Could not resolve host: github.com
  </code></pre>
  <p>I have also put the jsonnet repo in the distdir folder, but still getting this error.</p>