How to run heroku-buildpack-nginx locally in a docker container? - docker

I am trying to run this buildpack: https://github.com/heroku/heroku-buildpack-nginx locally in a docker container following the tutorial.
When I try to execute the second command after make shell I get this error:
$ make shell
$ cp bin/nginx-$STACK bin/nginx
$ FORCE=1 bin/start-nginx
cp: cannot stat 'bin/nginx-heroku-18': No such file or directory
I want to be able to start nginx buildpack to test it locally, but I am stuck at this error. Could someone help me please ? Thank you

You could use it with the pack CLI by following this tutorial on Using Heroku Buildpacks with Pack
Pack uses a newer version of the buildpack API, but the tutorial describes how to use an old buildpack with a shim so that it works.

Related

In which terminal do I run these commands?

I'm trying to create a buildpack with libwebp, and I'm trying to follow this tutorial, which starts with the following commands:
heroku create buildpack-stager
heroku run bash --app buildpack-stager
curl -O https://mupdf.googlecode.com/files/mupdf-1.3-source.tar.gz
tar -xvzf mupdf-1.3-source.tar.gz
...
Should these initial commands be run in the terminal of my application on heroku?
heroku create should be run on your local machine. This creates a new app on Heroku, so if you already have an app to work with it may not be necessary.
heroku run bash should also be run on your local machine. This spins up a one-off dyno for your app and runs the command bash on it.
From there, it looks like they want you to continue with curl, tar, etc. in the same shell as the previous step. The effect will be that these commands are run on the one-off dyno you're using, but you don't need to change terminals or anything.
You might find the Heroku CLI commands documentation page helpful.
All these commands you should run on your local terminal (bash, etc.)

"bash: aws: command not found" on Windows 7 in Git Bash

I'm trying to use AWS CLI to access CodeCommit. And it's sort of working. I am able to use the aws command in the Windows command prompt. However, when I try to access it using the Git Bash shell, it says
"bash: aws: command not found."
Additionally, when I try to do do a git clone in the Windows command promt, trying to access CodeCommit, it tries to use aws using the credentials helper, which also results in "aws: command not found."
I followed the instructions in the AWS documentation, which suggests some directories to add to the PATH:
https://docs.aws.amazon.com/cli/latest/userguide/awscli-install-windows.html#awscli-install-windows-path
Here's what my PATH variable looks like:
C:\Users\ddrayton\AppData\Local\Programs\Python\Python36\Scripts\;C:\Users\ddrayton\AppData\Local\Programs\Python\Python36\;C:\Windows\System32;;C:\Program
Files\Docker
Toolbox;C:\Users\ddrayton\MyCurl;%USERPROFILE%\AppData\Local\Programs\Python\Python36\Scripts;C:\Program
Files\Amazon\AWSCLI;C:\Program Files
(x86)\Amazon\AWSCLI;C:\Users\ddrayton\AppData\Local\Programs\Python\Python36;C:\Users\ddrayton\AppData\Local\Programs\Python\Python36\Scripts
But I'm not sure if it's a PATH problem, since the Windows command prompt has no problem accessing the "aws" command.
Any ideas?
Fixed this by simply installing the AWS CLI again but this time using Git Bash instead of the Windows command prompt.
pip install awscli
If anyone could provide some insight as to why this was necessary, it would be appreciated.
In my case, I think a recent-to-me update to the AWS CLI changed what's run to being aws.cmd (full path C:\Program Files\Amazon\AWSCLI\bin\aws.cmd)
Git Bash needs the extension aws.cmd to make it work.
In Bash, you could try typing aws.cmd vs aws. If the former works, but not the latter, you can do alias aws='aws.cmd' in your bash startup script. I don't know if it's the best solution, but it worked for me.
FWIW, I think it's related to this:
https://unix.stackexchange.com/questions/280528/is-there-a-unix-equivalent-of-the-windows-environment-variable-pathext
On Windows 10 I was installing just once from GitBash via pip install awscli --upgrade --user as described in AWS manual for CLI installation for Linux
It installed aws executables into %USERPROFILE%\AppData\Roaming\Python\Python37\Scripts
After that just add this folder to your PATH. Re-open GitBash or cmd - it should work from both places

Redmine plugin creation - Could not find generator 'redmine_plugin'

I run Redmine 3.4 with Rails (5.2.0) and Docker 18.03.1-ce on Ubuntu 16.04 Xenial (which is new for me), following this GitHub repository: https://github.com/sameersbn/docker-redmine
I create my Rails app in the same folder where the docker-compose.yml has been created, and cd to it.
Then I have the exact same problem than described in this Redmine post (http://www.redmine.org/boards/3/topics/48309?r=48507#message-48507): when I try the command rails generate redmine_plugin Plug_test, this two error messages appear:
Running via Spring preloader in process 32109
Could not find generator 'redmine_plugin'
So I try the commands that Keith suggested, and running the generate command again, the Spring error message disappear, but the generate command still doesn't work (Could not find generator 'redmine_plugin').
Any idea what to do? I don't know if I'm going in the right direction.
Thanks a lot for your help.
well simple problem, you're running command from outside of your redmine app directory, you need to go into your redmine app directory, after that you can run rails generate redmine_plugin Plugin_test from there
As Ravi mentioned above, you need to go into your redmine app directory instead of your rails app directory.
Or, maybe you can exec plugin generate command via docker run command.
# e.g. In case plugin name is “myplugin"
docker run --name=redmine -it --rm \
--volume=/srv/docker/redmine/redmine:/home/redmine/data \
sameersbn/redmine:3.4.4-2 \
app:rails generate redmine_plugin myplugin
If this works fine, plugin directory named “myplugin” will be generated under /srv/docker/redmine/redmine/plugins/ directory.
Personally, I think, you had batter not use docker to create and development Redmine’s plugin, especially if you are not familiar with Redmine and Docker so much.
I hope this would be any help.

cp: cannot stat on ./startFabric.sh in Docker for Hyperledger Fabric-Writing Yout First Application

I am currently trying to learn Hyperledger Fabric. I have followed all the instructions till here. I have gotten all the necessary binaries and downloaded all the required samples. When I go into the Fabcar folder and use the "ls" command, I can see all the files expected according to the document EXCEPT chaincode.
$ ls
creds/ invoke.js package.json query.js startFabric.sh*
When I run "./startFabric.sh" command, I get the following errors:
$ ./startFabric.sh
cp: cannot stat '/c/Users/Vaibhav': No such file or directory
cp: cannot stat 'Shah/fabric-samples/fabcar/creds/*': No such file or directory
I am attaching a screenshot of the entire Docker interface below.
Thank you very much.
Screenshot of error in Docker
Check this example in https://github.com/hyperledger/fabric/tree/release/examples/e2e_cli
This is the end-to-end test of the fabric using the command line interface. It helps you understand installation, setting up channels and executing if I recall chaincode_example02. Obviously, this runs on Ubuntu 14.04.
If you are a Windows user, you may want to spin up an Ubuntu 14.04 VM and try out, after installing all the pre-requisites.

Restarting daemon built in Ruby on Rails

I am trying to restart a daemon called site_checker.rb using SSH commands through PuTTY. This file is located in:
/home/MYUSERNAME/web/current/lib/daemons
After logging into my website, which is built with Ruby on Rails, I see the following on-screen:
[MYUSERNAME#MYUSERNAME ~]$
From here, I enter
[MYUSERNAME#MYUSERNAME ~]$ cd web
and then
[MYUSERNAME#MYUSERNAME ~/web]$ script/daemons start
However, I get an error:
-bash: script/daemons: No such file or directory
You try to start /home/MYUSERNAME/web/lib/daemons while you claim your script is actually in /home/MYUSERNAME/web/current/lib/daemons. You are missing the current.

Resources